S = input()

flag = False
ans = 0
for i in range(len(S)):
    if S[i] == 'R':
        ans += 1
        flag = True
    elif S[i] == 'S' and flag:
        break

print(ans) S = input() S input() input flag = False flag False ans = 0 ans 0 for i in range(len(S)):
    if S[i] == 'R':
        ans += 1
        flag = True
    elif S[i] == 'S' and flag:
        break i range(len(S)) range len(S) len S if S[i] == 'R':
        ans += 1
        flag = True
    elif S[i] == 'S' and flag:
        break S[i] == 'R' S[i] S i 'R' ans += 1 ans 1 flag = True flag True elif S[i] == 'S' and flag:
        break S[i] == 'S' and flag S[i] == 'S' S[i] S i 'S' flag break print(ans) print ans flag = False False flag ans += 1 1 ans flag = True True flag S = input() input() S ans = 0 0 ans
S = input()

flag = False
ans = 0
for i in range(len(S)):
    if S[i] == 'R':
        ans += 1
        flag = True
    elif S[i] == 'S' and flag:
        break

print(ans)
