#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
int main() {
  string X;
  cin >> X;
  int ans = 0, i = X.size() - 1;
  while (X[i] == 'S') {
    ans += 2;
    i--;
  }
  cout << ans << endl;
}
