s=input()
if s=="RRR":print(3)
elif s=="RRS" or s=="SRR":print(2)
elif s=="SSS":print(0)
else:print(1) s=input() s input() input if s=="RRR":print(3)
elif s=="RRS" or s=="SRR":print(2)
elif s=="SSS":print(0)
else:print(1) s=="RRR" s "RRR" elif s=="RRS" or s=="SRR":print(2) s=="RRS" or s=="SRR" s=="RRS" s "RRS" s=="SRR" s "SRR" elif s=="SSS":print(0) s=="SSS" s "SSS" s=input() input() s
s=input()
if s=="RRR":print(3)
elif s=="RRS" or s=="SRR":print(2)
elif s=="SSS":print(0)
else:print(1)