S = input()

if S == "SSS":
	print(0)
elif S == "RRR":
	print(3)
elif S[0] == S[1] == "R" or S[1] == S[2] == "R":
	print(2)
else:
	print(1) S = input() S input() input if S == "SSS":
	print(0)
elif S == "RRR":
	print(3)
elif S[0] == S[1] == "R" or S[1] == S[2] == "R":
	print(2)
else:
	print(1) S == "SSS" S "SSS" print(0) print 0 elif S == "RRR":
	print(3) S == "RRR" S "RRR" print(3) print 3 elif S[0] == S[1] == "R" or S[1] == S[2] == "R":
	print(2) S[0] == S[1] == "R" or S[1] == S[2] == "R" S[0] == S[1] == "R" S[0] == S[1] S[0] S 0 S[1] S 1 "R" S[1] == S[2] == "R" S[1] == S[2] S[1] S 1 S[2] S 2 "R" print(2) print 2 print(1) print 1 S = input() input() S
S = input()

if S == "SSS":
	print(0)
elif S == "RRR":
	print(3)
elif S[0] == S[1] == "R" or S[1] == S[2] == "R":
	print(2)
else:
	print(1)
