main :-
	read_str(S),
	weather(S, X),
	write(X),
	nl,
	halt.

weather("RRR", 3).
weather("RRS", 2).
weather("RSR", 1).
weather("RSS", 1).
weather("SRR", 2).
weather("SRS", 1).
weather("SSR", 1).
weather("SSS", 0).

read_str(S) :-
        read_string(current_input, ' \n', '', _, S).

