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