Given a string of characters, you may find that the word "seven" is hidden inside. For example, in the string "sesveven", five 7's are hidden:
sesveven
sesveven
sesveven
sesveven
sesveven
Your task is to count the number of different 7's.
Note
Upper-case letters are considered as the same as the lower-case letters.
Input
Each case gives the string in a line. The length of the string is not more than 10000.
Output
For each test cases, output in a line the number of different 7's hidden inside the string. The result will be less than 2^63.
Sample Input
sesveven
seSvevEn
Sample Output
5
5
乘法原理
char str[10005];
int main(){
long long sums,sume,sumv,sumee,sumn;
while(gets(str)){
sums=sume=sumv=sumee=sumn=0;
int len=strlen(str);
for(int i=0;i<len;i++){
char ch=tolower(str[i]);
if(ch=='s')
sums++;
else if(ch=='e'){
sume+=sums;
sumee+=sumv;
}
else if(ch=='v')
sumv+=sume;
else if(ch=='n')
sumn+=sumee;
}
cout<<sumn<<endl;
}
return 0;
}