S = input().replace("-","") cnt = 0 for i in range(2,len(S)): if S[i-2] == "m" and S[i-1] == "i" and S[i] == "n": cnt += 1 print(cnt)