s = eval(input())

if s[0] == s[1] == s[2] == "R":

    print((3))

elif s[0] == s[1] == "R" or s[1] == s[2] == "R":

    print((2))

elif "R" in s:

    print((1))

else:

    print((0))
s = eval(input())

if s == "RRR":

    print((3))

elif "RR" in s:

    print((2))

elif "R" in s:

    print((1))

else:

    print((0))
s = eval(input())
if s[0] == s[1] == s[2] == "R":
    print((3))
elif s[0] == s[1] == "R" or s[1] == s[2] == "R":
    print((2))
elif "R" in s:
    print((1))
else:
    print((0))

s = eval(input())
if s == "RRR":
    print((3))
elif "RR" in s:
    print((2))
elif "R" in s:
    print((1))
else:
    print((0))

-if s[0] == s[1] == s[2] == "R": +if s == "RRR": -elif s[0] == s[1] == "R" or s[1] == s[2] == "R": +elif "RR" in s: