import re def main(): s = input() result = judge(s) print(result) def judge(s): """ >>> judge('mi--nminminminmi-------n') 5 """ result = re.findall("mi-*n",s) return len(result) if __name__=='__main__': import doctest doctest.testmod() main()