#include <bits/stdc++.h>
using namespace std;
int main()
{long long t,i,n,k,x,y,m,j;
string s;
cin>>s;x=0;
if(s[0]=='R')x=x+1;if(s[1]=='R')x=x+1;if(s[2]=='R')x=x+1;
if(x==2){if(s[1]=='S')cout<<1;else cout<<x;}
else cout<<x;
return 0;}
