 #include<bits/stdc++.h>
  using namespace std;
  #define       M                        1000000007
  #define       ll                       long long
  #define       FIO                      ios_base::sync_with_stdio(false);cin.tie(NULL)
  #define       ifor(st,lim)             for(int i=st;i<lim;i++)
  #define       jfor(stt,llim)           for(int j=stt;j<llim;j++)
  #define       eifor(st,lim)            for(int i=st;i<=lim;i++)
  #define       ejfor(stt,llim)          for(int j=stt;j<=llim;j++)
  #define       blank                    cout<<'\n' 


void solve()
{ 
   string s; cin>>s;
   
   if(s[0] == s[1] && s[1] == s[2] && s[0] == 'R') cout<<"3";
   else if(s[0] == s[1] && s[0] == 'R') cout<<"2";
   else if(s[1] == s[2] && s[1] == 'R') cout<<"2";
   else if(s[0] == 'R' || s[1] == 'R' || s[2] == 'R') cout<<"1";
   else cout<<"0";   
}
 
  int main()
  {
  #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
  #endif
  int t=1;
  while(t--){
      solve();
     } 
  }
#include <bits/stdc++.h>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
//#define INF 2e9
#define ALL(v) v.begin(), v.end()
 
using namespace std;
typedef long long ll;

int main(){
    string W;
    cin >> W;
    int result=0;
    if(W[0]=='R'){
        result=1;
        if(W[1]=='R'){
            result=2;
            if(W[2]=='R'){
                result=3;
            }
        }
    }
    if(W[1]=='R'){
        if(result<1) result=1;
        if(W[2]=='R'){
            if(result<2) result=2;
        }
    }
    if(W[2]=='R'){
        if(result<1) result=1;
    }
    cout << result << endl;
    return 0;
}