import re print(len(re.search("mi[-]*n",input()).group()))