#include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair P; typedef pair P3; typedef pair

PP; const ll MOD = ll(1e9+7); const int IINF = INT_MAX; const ll LLINF = LLONG_MAX; const int MAX_N = int(1e6 + 5); const double EPS = 1e-6; const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0}; #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define SORT(v) sort((v).begin(), (v).end()) #define SORTR(v) sort((v).rbegin(), (v).rend()) #define ALL(v) (v).begin(), (v).end() int main() { int n, ans = 0; string s; cin >> n >> s; REP(i,n){ if(s[i]=='M'){ for(int j=1;i-j>=0 && i+j