#include<bits/stdc++.h> #define int long long usingnamespace std; int dp[1000005]; char s[1000005]; signedmain() { int n, i, summ = 0, res = 0; scanf("%s", s + 1); n = strlen(s + 1); for (i = 1; i <= n; i++) { if (s[i] == 'F') { if (summ) dp[i] = max(dp[i - 1] + 1, summ);