#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
using namespace std;
int main() {
  string s;
  cin >> s;
  list<int> list_;
  for (int i = 0; i < (s.size()); ++i) list_.push_back((s[i] == 'S' ? 0 : 1));
  auto itr = list_.begin();
  while (itr != list_.end()) {
    for (auto&(a) : (list_)) {
      cout << a;
    }
    cout << endl;
    if (*itr == 0) {
      auto itrt = find(itr, list_.end(), 1);
      if (itrt != list_.end()) {
        *itr = 2;
        list_.erase(itrt);
      } else {
        list_.erase(itr);
        break;
      }
    } else
      itr++;
  }
  int sum = 0;
  for (auto&(a) : (list_)) {
    if (a != 2) ++sum;
  }
  cout << (sum == 0 ? 0 : sum + 1) << endl;
  return 0;
}
