S = raw_input().split("n") for i in range(len(S)): if "mi" not in S[i]: S.pop(i) print len(S)