#include using namespace std; typedef long long ll; int main() { string s; cin>>s; int ans = 0; for (auto c : s) if (c == 'm') ans++; cout << ans << endl; return 0; }