s = input() temp = "" count = 0 mi = False for i in s: if mi: if i == 'n': count += 1 else: min = False temp = i else: if temp + i == 'mi': mi = True temp = i else: temp = i print(count)