#A

stri=eval(input())

ans=0

s=0

for i in range(3):

    if stri[i]=="R":

        s+=1

    else:

        if ans<s:

            ans=s

        s=0

if ans<s:

    ans=s

print(ans)
# A

s = eval(input())

count = 0

ans = 0

for i in range(len(s)):

    if s[i] == "R":

        count += 1

    else:

        if ans < count:

            ans = count

        count = 0

if ans < count:

    ans = count

print(ans)

# A
stri = eval(input())
ans = 0
s = 0
for i in range(3):
    if stri[i] == "R":
        s += 1
    else:
        if ans < s:
            ans = s
        s = 0
if ans < s:
    ans = s
print(ans)

# A
s = eval(input())
count = 0
ans = 0
for i in range(len(s)):
    if s[i] == "R":
        count += 1
    else:
        if ans < count:
            ans = count
        count = 0
if ans < count:
    ans = count
print(ans)

-stri = eval(input()) +s = eval(input()) +count = 0 -s = 0 -for i in range(3): -    if stri[i] == "R": -        s += 1 +for i in range(len(s)): +    if s[i] == "R": +        count += 1 -        if ans < s: -            ans = s -        s = 0 -if ans < s: -    ans = s +        if ans < count: +            ans = count +        count = 0 +if ans < count: +    ans = count