s = eval(input())



if 'RRR' in s:

    print((3))

elif 'RR' in s:

    print((2))

elif 'R' in s:

    print((1))

else:

    print((0))

    
s = eval(input())



for i in [3, 2, 1, 0]:

    if 'R' * i in s:

        print(i)

        break

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

s = eval(input())
for i in [3, 2, 1, 0]:
    if "R" * i in s:
        print(i)
        break

-if "RRR" in s: -    print((3)) -elif "RR" in s: -    print((2)) -elif "R" in s: -    print((1)) -else: -    print((0)) +for i in [3, 2, 1, 0]: +    if "R" * i in s: +        print(i) +        break