#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int len = s.size(), ct = 0;
  for (int i = len - 1; i >= 0; i--) {
    if (s[i] == 'S') {
      ct = ct + 2;
    } else {
      break;
    }
  }
  cout << ct << endl;
  return 0;
}
