S = str(eval(input()))



if S =="RRR":

  ans = 3

elif S =="SRR" or S == "RRS":

  ans = 2

else:

  S = list(S)

  if "R" in S:

    ans = 1

  else:

    ans = 0

print(ans)
S= str(eval(input()))



if "RRR" in S:

  print("3")

elif "RR" in S:

  print("2")

elif "R" in S:

  print("1")

else:

  print("0")
S = str(eval(input()))
if S == "RRR":
    ans = 3
elif S == "SRR" or S == "RRS":
    ans = 2
else:
    S = list(S)
    if "R" in S:
        ans = 1
    else:
        ans = 0
print(ans)

S = str(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 == "RRR": -    ans = 3 -elif S == "SRR" or S == "RRS": -    ans = 2 +if "RRR" in S: +    print("3") +elif "RR" in S: +    print("2") +elif "R" in S: +    print("1") -    S = list(S) -    if "R" in S: -        ans = 1 -    else: -        ans = 0 -print(ans) +    print("0")