#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, int> mp;
  long long int n, m = 0;
  long double dp[4000][1505] = {}, p[4000], tmp = 0;
  string str, str2;
  cin >> str;
  for (int i = 0; i < str.length(); i++) {
    if (str[str.length() - 1 - i] == 'S') {
      m += 2;
    } else {
      break;
    }
  }
  cout << m;
}
