#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int a = s.length();
  long i, ans = 0;
  for (i = a - 1; i >= 0; i--) {
    if (s[i] == 'S') {
      ans++;
      continue;
    }
    break;
  }
  printf("%ld\n", a - ans);
  return 0;
}
