W = eval(input())

if W == 'RRR':

    print((3))

elif W == 'SSS':

    print((0))

elif any([W == 'RRS',  W == 'SRR']):

    print((2))

else:

    print((1))
W = eval(input())

cnt = 0

max_cnt = 0

for i in range(3):

    if W[i] == 'S':

        cnt = 0

    else:

        cnt += 1

        max_cnt = max(max_cnt, cnt)



print(max_cnt)
W = eval(input())
if W == "RRR":
    print((3))
elif W == "SSS":
    print((0))
elif any([W == "RRS", W == "SRR"]):
    print((2))
else:
    print((1))

W = eval(input())
cnt = 0
max_cnt = 0
for i in range(3):
    if W[i] == "S":
        cnt = 0
    else:
        cnt += 1
        max_cnt = max(max_cnt, cnt)
print(max_cnt)

-if W == "RRR": -    print((3)) -elif W == "SSS": -    print((0)) -elif any([W == "RRS", W == "SRR"]): -    print((2)) -else: -    print((1)) +cnt = 0 +max_cnt = 0 +for i in range(3): +    if W[i] == "S": +        cnt = 0 +    else: +        cnt += 1 +        max_cnt = max(max_cnt, cnt) +print(max_cnt)