#include <iostream>

using namespace std;
int main()
{
	string a;
	cin >> a;
	if (a == "RRS" || a == "SRR"){
		cout << "2";
	}
	else if (a == "SSS"){
		cout << "0";
	}
	else if (a == "RRR"){
		cout << "3";
	}
	else cout << "1";
	return 0;
}