#include<bits/stdc++.h>
using namespace std;

int main(){
	string s;
	cin >> s;
	int ans = 0;
	int i = 0;
	while(i < s.length()){
		if(s[i] == 'm'){
			i++;
			if(s[i] == 'i'){
				i++;
				if(s[i] == '-'){
					while(s[i] == '-'){
						i++;
					}
				}
				if(s[i] == 'n'){
					ans++;
					i++;
				}else{
					i++;
				}
			}else{
				i++;
			}
		}else{
			i++;
		}
	}
	cout << ans << endl;
	
}