# coding: utf-8 import re a = input() pattern = re.compile(r'mi.*?n') matchedList = pattern.findall(a) if matchedList: print(len(matchedList))