s = input()
d = 0

if s == "RRR":
    d = 3
elif s in {"RRS", "SRR"}:
    d = 2
elif s in {"RSR", "RSS", "SSR", "SRS"}:
    d = 1
else:
    d = 0

print(d) s = input() s input() input d = 0 d 0 if s == "RRR":
    d = 3
elif s in {"RRS", "SRR"}:
    d = 2
elif s in {"RSR", "RSS", "SSR", "SRS"}:
    d = 1
else:
    d = 0 s == "RRR" s "RRR" d = 3 d 3 elif s in {"RRS", "SRR"}:
    d = 2 s in {"RRS", "SRR"} s {"RRS", "SRR"} d = 2 d 2 elif s in {"RSR", "RSS", "SSR", "SRS"}:
    d = 1 s in {"RSR", "RSS", "SSR", "SRS"} s {"RSR", "RSS", "SSR", "SRS"} d = 1 d 1 d = 0 d 0 print(d) print d d = 3 3 d d = 0 0 d s = input() input() s d = 0 0 d d = 2 2 d d = 1 1 d
s = input()
d = 0

if s == "RRR":
    d = 3
elif s in {"RRS", "SRR"}:
    d = 2
elif s in {"RSR", "RSS", "SSR", "SRS"}:
    d = 1
else:
    d = 0

print(d)
