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

int main(){
  string sa;
  cin >> sa;
  int chain = 0;
  int ma = 0;
  for (char j : sa){
    if (j == 'R'){
      chain ++;
    }else chain = 0;
    ma = max(ma,chain);
  }
  cout << ma << endl;
}
#include <bits/stdc++.h>
#define INF INT_MAX
#define ll  long long
#define ull unsigned long long
#define rep(i,n) for(ll i=0; i<n; ++i)
#define FOR(i, s, e) for(ll i=s; i<e; ++i)
#define MOD 1000000007
using namespace std;
template<class T> inline bool chmin(T& a, T b) { if(a>b) {a=b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) { if(a<b) {a=b; return true;} return false;}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S; cin >> S;
  if(S == "RRS" || S == "SRR") cout << 2 << endl;
  else if(S == "RRR") cout << 3 << endl;
  else if(S == "SSS") cout << 0 << endl;
  else cout << 1 << endl;
}