S = eval(input())



if S.count("RRR") == 1:

    print((3))

elif S.count("RRS") == 1 or S.count("SRR") == 1:

    print((2))

elif S.count("SSS") == 1:

    print((0))

else:

    print((1))
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())
if S.count("RRR") == 1:
    print((3))
elif S.count("RRS") == 1 or S.count("SRR") == 1:
    print((2))
elif S.count("SSS") == 1:
    print((0))
else:
    print((1))

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

-if S.count("RRR") == 1: +if "RRR" in S: -elif S.count("RRS") == 1 or S.count("SRR") == 1: +elif "RR" in S: -elif S.count("SSS") == 1: +elif "R" in S: +    print((1)) +else: -else: -    print((1))