#include <bits/stdc++.h>
using namespace std;
const int N = (int)0, mod = (int)0;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int n = (int)s.size() - 1, m = 0;
  while (s[n] == 'S') n--, m++;
  cout << m * 2;
}
