import sys readline=sys.stdin.readline lst=[] ans=0 for s in readline().rstrip(): if len(lst)==0 and s=="m": lst.append(s) elif len(lst)==1 and s=="i": lst.append(s) elif len(lst)==2 and s=="n": lst.append(s) if len(lst)==3: ans+=1 lst=[] print(ans)