#include <bits/stdc++.h>
 
using namespace std;
 
int main()
{
  string s;
  cin>>s;
  int c = 0;
  for (char c1 : s) if (c1 == 'R') c++;
  if (c != 2) cout << c << '\n';
  else if (s[1] == 'S') cout << 1 << '\n';
  else cout << '2' << '\n';
  return 0;
}
#include <iostream>

using namespace std;

int main()
{
    string S;
    cin>>S;
    char a=S[0]=='R';
     char b=S[1]=='R';
      char c=S[2]=='R';

     if(a&b&c)
     {
         cout<<"3";
     }
     else if(a&b||b&c)
     {
         cout<<"2";
     }
     else if(a|b|c)
     {
         cout<<"1";

     }
     else
     {

    cout<<"0";
     }
    return 0;
    }
