using System;
using System.Collections.Generic;
class Program
{
///
/// プログラムのエントリポイント
///
///
static void Main(string[] args)
{
string s = Console.ReadLine().Replace("-", "");
int mincount = 0;
int searchIndex = 0;
while(true)
{
if(s.IndexOf("min", searchIndex) >= 0)
{
if (searchIndex + 3 >= s.Length)
mincount++;
else if (s[searchIndex + 3] == 'm')
mincount++;
searchIndex += 3;
continue;
}
break;
}
Console.WriteLine(mincount);
}
}