# Print coderinme Hackerearth problem coderinme

##### Print coderinme

As a beginner to the programming, Sana came to Coderinme platform, to become a better programmer. She solved some problems and felt very confident. Later being a fan of Coderinme, she gave a problem to her friends to solve. They will be given a string containing only lower case characters (a-z), and they need to find that by using the characters of the given string, how many times they can print “Coderinme”(without quotes). As they are new to programming world, please help them.

Input:
The first line will consists of one integer
N
N denoting the length of string.
Next line will contain the string
S
t
r
Str containing only lower case characters.

Output:
Print one integer, denoting the number of times her friends can print “Coderinme” (without quotes).

Constraints:
1

N

10
6
1≤N≤106
Each character of string
S
t
r
Str will be in range
[
a
,
z
]
[a,z]

``````#include <iostream>
#include <string>
using namespace std;

int main()
{
long int m,n;
cin>>n;
string Str;
cin>>Str;
int s={0};
for(int i=0;i<n;i++)
{
if(Str[i]=='c') s++;
else if(Str[i]=='o') s++;
else if(Str[i]=='d') s++;
else if(Str[i]=='e') s++;
else if(Str[i]=='i') s++;
else if(Str[i]=='r') s++;
else if(Str[i]=='n') s++;
else if(Str[i]=='m') s++;
}
s/=2;
m=s+s+s+s+s+s+s+s;
for(int i=0;i<8;i++)
{
if(s[i]<m) m=s[i];
}
cout<<m;
return 0;
}
`````` Competitive

Hackerearth Archive

### hasectic

A web developer(Front end and Back end), and DBA at csdamu.com. Currently working as Salesforce Developer @ Tech Matrix IT Consulting Private Limited. Check me @about.me/s.saifi