#include<bits/stdc++.h>
using namespace std;
string d;
string c[]={"SSS","RRR","RRS","SRR"};
int main()
{
	cin>>d;
	if(d==c[0]) cout<<0;
	else if(d==c[1]) cout<<3;
	else if(d==c[2]||d==c[3]) cout<<2;
	else cout<<1;
	return 0;
}