a=input()
if a=="SSS": print(0)
elif a=="RRR":print(3)
elif a in ["SSR","SRS","RSS","RSR"]:print(1)
else:print(2) a=input() a input() input if a=="SSS": print(0)
elif a=="RRR":print(3)
elif a in ["SSR","SRS","RSS","RSR"]:print(1)
else:print(2) a=="SSS" a "SSS" elif a=="RRR":print(3) a=="RRR" a "RRR" elif a in ["SSR","SRS","RSS","RSR"]:print(1) a in ["SSR","SRS","RSS","RSR"] a ["SSR","SRS","RSS","RSR"] "SSR" "SRS" "RSS" "RSR" a=input() input() a
a=input()
if a=="SSS": print(0)
elif a=="RRR":print(3)
elif a in ["SSR","SRS","RSS","RSR"]:print(1)
else:print(2)