S = eval(input())

RC = S.count('R')

if S[1] == 'S' and RC == 2:

    print((1))

else:

    print(RC)

S = eval(input())

# RC = S.count('R')

# if S[1] == 'S' and RC == 2:

    # print(1)

# else:

    # print(RC)



rs = S.split('S')

ans = 0

for r in rs:

    ans = max(ans, len(r))

print(ans)

S = eval(input())
RC = S.count("R")
if S[1] == "S" and RC == 2:
    print((1))
else:
    print(RC)

S = eval(input())
# RC = S.count('R')
# if S[1] == 'S' and RC == 2:
# print(1)
# else:
# print(RC)
rs = S.split("S")
ans = 0
for r in rs:
    ans = max(ans, len(r))
print(ans)

-RC = S.count("R") -if S[1] == "S" and RC == 2: -    print((1)) -else: -    print(RC) +# RC = S.count('R') +# if S[1] == 'S' and RC == 2: +# print(1) +# else: +# print(RC) +rs = S.split("S") +ans = 0 +for r in rs: +    ans = max(ans, len(r)) +print(ans)