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