S = list(input())
a = 0
for i in S:
    if i == 'R':
        a += 1
if a == 2:
    if S[1] == 'S':
        a = 1
print(a) S = list(input()) S list(input()) list input() input a = 0 a 0 for i in S:
    if i == 'R':
        a += 1 i S if i == 'R':
        a += 1 i == 'R' i 'R' a += 1 a 1 if a == 2:
    if S[1] == 'S':
        a = 1 a == 2 a 2 if S[1] == 'S':
        a = 1 S[1] == 'S' S[1] S 1 'S' a = 1 a 1 print(a) print a a = 1 1 a a += 1 1 a a = 0 0 a S = list(input()) list(input()) S
S = list(input())
a = 0
for i in S:
    if i == 'R':
        a += 1
if a == 2:
    if S[1] == 'S':
        a = 1
print(a)
