a=list(eval(input()))

if a[0]=="R":

  if a[1]=="S":

    print((1))

  else:

    if a[2]=="R":

      print((3))

    else:

      print((2))

else:

  if a[1]=="R" and a[2]=="R":

    print((2))

  elif a[1]=="S" and a[2]=="S":

    print((0))

  else:

    print((1))
s=list(eval(input()))

c=0

l=[]

for i in range(3):

    if s[i]=="R":

        c+=1

    else:

        c=0

    l.append(c)

print((max(l)))

        
a = list(eval(input()))
if a[0] == "R":
    if a[1] == "S":
        print((1))
    else:
        if a[2] == "R":
            print((3))
        else:
            print((2))
else:
    if a[1] == "R" and a[2] == "R":
        print((2))
    elif a[1] == "S" and a[2] == "S":
        print((0))
    else:
        print((1))

s = list(eval(input()))
c = 0
l = []
for i in range(3):
    if s[i] == "R":
        c += 1
    else:
        c = 0
    l.append(c)
print((max(l)))

-a = list(eval(input())) -if a[0] == "R": -    if a[1] == "S": -        print((1)) +s = list(eval(input())) +c = 0 +l = [] +for i in range(3): +    if s[i] == "R": +        c += 1 -        if a[2] == "R": -            print((3)) -        else: -            print((2)) -else: -    if a[1] == "R" and a[2] == "R": -        print((2)) -    elif a[1] == "S" and a[2] == "S": -        print((0)) -    else: -        print((1)) +        c = 0 +    l.append(c) +print((max(l)))