#include <bits/stdc++.h>
long long mod = 1e9 + 7;
const int iINF = 0x3f3f3f3f;
const long long INF = 1LL << 60;
using namespace std;
using pint = pair<int, int>;
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  string x;
  cin >> x;
  reverse(x.begin(), x.end());
  int count = 0;
  for (char c : x) {
    if (c == 'S')
      count++;
    else
      break;
  }
  cout << count * 2 << endl;
  return 0;
}
