#include <algorithm>
#include <iostream>

using namespace std;

int main() {
	string s; cin >> s;
	cout << (s == "RRR" ? 3 : s == "RRS" || s == "SRR" ? 2 : s == "RSS" || s == "SRS" || s == "SSR" || s == "RSR" ? 1 : 0) << '\n';
	return 0;
}
