S = list(str(input()))

count = 0
max = 0

for i in range(3):
    if S[i] == "R":
        count += 1
    else:
        if max < count:
            max = count
        count = 0
if max < count:
    max = count

print(max) S = list(str(input())) S list(str(input())) list str(input()) str input() input count = 0 count 0 max = 0 max 0 for i in range(3):
    if S[i] == "R":
        count += 1
    else:
        if max < count:
            max = count
        count = 0 i range(3) range 3 if S[i] == "R":
        count += 1
    else:
        if max < count:
            max = count
        count = 0 S[i] == "R" S[i] S i "R" count += 1 count 1 if max < count:
            max = count
         max < count max count max = count max count count = 0 count 0 if max < count:
    max = count max < count max count max = count max count print(max) print max S = list(str(input())) list(str(input())) S count = 0 0 count max = 0 0 max count = 0 0 count max = count count max max = count count max count += 1 1 count
S = list(str(input()))

count = 0
max = 0

for i in range(3):
    if S[i] == "R":
        count += 1
    else:
        if max < count:
            max = count
        count = 0
if max < count:
    max = count

print(max)