#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int main()
{
string str;
cin >> str;
int k = 0;
while (k < str.size() && str[k] == 'F') k ++ ;
str = str.substr(k);
int t = 0, cnt = 0;
for (auto c: str)
if (c == 'M') cnt ++ ;
else t = max(t + 1, cnt);
cout << t << endl;
return 0;
}
3700. 女士优先 思维
最新推荐文章于 2024-08-06 17:42:20 发布