# coding: utf-8

# Your code here!



s=eval(input())



if "RRR"==s:

    print((3))

elif "RR" in s:

    print((2))

elif "R" in s:

    print((1))

else:

    print((0))
s=eval(input())

if s=="RRR":

  print((3))

elif s=="SSS":

  print((0))

elif "RR" in s:

  print((2))

else:

  print((1))
# coding: utf-8
# Your code here!
s = eval(input())
if "RRR" == s:
    print((3))
elif "RR" in s:
    print((2))
elif "R" in s:
    print((1))
else:
    print((0))

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

-# coding: utf-8 -# Your code here! -if "RRR" == s: +if s == "RRR": +elif s == "SSS": +    print((0)) -elif "R" in s: +else: -else: -    print((0))