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

#define _GLIBCXX_DEBUG

//vector<int> A(M), B(M);
//vector<vector<char>> answer(N, vector<char>(N, '-'));

int main() {
  string s;
  int ans = 0;
  
  cin >> s;
  
  if(s[0] == 'R'){
    ans++;
    if(s[1] == 'R'){
      ans++;
      if(s[2] == 'R') ans++;
    }
  }
  
  else{
    if(s[1] == 'R'){
      ans++;
      if(s[2] == 'R') ans++;
    }
    else{
      if(s[2] == 'R') ans++;
    }
  }
  
  cout << ans << endl;
  
  return 0;
}
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<iomanip>
#define pi 3.14159265358979323846
#define ll long long
#define rep(i, a, n) for(int i = a; i < n; i++)
using namespace std;
int main(){
  string s;
  cin >> s;
  if(s == "RRR"){
    cout << "3\n";
    return 0;
  }
  if(s == "RRS" || s == "SRR"){
    cout << "2\n";
    return 0;
  }
  if(s == "SSS"){
    cout << "0\n";
    return 0;
  }
  cout << "1\n";
  return 0;
}