print((function (s, t) local r=0 for _ in s:gmatch(t) do r=r+1 end return r end)(io.stdin:read("*l"), "mi%-*n"))