#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  int idx = 0;
  reverse(s.begin(), s.end());
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != 'S') {
      idx = i;
      break;
    }
  }
  cout << idx * 2 << endl;
}
