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

int main()
{
  string S;
  cin >> S;
  
  if(S == "SSS") cout << "0" << endl;
  else if(S == "RRR") cout << "3" << endl;
  else if(S == "SRR" || S == "RRS") cout << "2" << endl;
  else cout << "1" << endl;
}
#include<iostream>
#include<cstring>

using namespace std;

char str[1010];

int main(){
    scanf("%s",str);
    int len=strlen(str);
    int res=0;
    for(int i=0;i<len;++i){
        int cnt=0;
        while(i<len&&str[i]=='R'){
            cnt++;
            i++;
        }
        res=max(cnt,res);
    }
    cout<<res<<endl;
    return 0;
}