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