#include <iostream>
using namespace std;

int main()
{
    string w;
    cin >> w;
    int c = 0;
    if (w == "RRR")
    {
        c = 3;
    }
    else if (w== "RRS" || w == "SRR")
    {
        c= 2;
    }
    else if (w == "SRS" || w == "RSR" || w == "SSR" || w == "RSS")
    {
        c = 1;
    }

    cout << c << endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    string s;
    cin>>s;
    int ans = 0;
    int ma = INT_MIN;
    for(int i=0;i<s.size();i++) {
        if(s[i] == 'R') {
            ans++;
        }
        else {
            ma = max(ma, ans);
            ans = 0;
        }
    }
     ma = max(ma, ans);

    cout<<ma<<endl;
}
