#include <bits/stdc++.h>
using namespace std;


int main()
{

	string s;
	int a=s.length();
	long i,ans=0;
	for(i=a-1;i>=0;i--)
	{
		if(s[i]=='S')
			{ans++;continue;}
		break;
	}
	printf("%ld\n",n-ans);

	return 0;
}