#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[200002];
  cin >> s;
  for (int i = strlen(s) - 1; i > -1; i--) {
    if (s[i] == 'T') {
      cout << strlen(s) - 1 - i;
      return 0;
    }
  }
}
