a = input('')
S = []
num = 0
for i in a:
    S.append(i)
for j in range(3):
    if S[j] == 'R':
        num += 1
if num == 2 and S[1] == 'S':
    print(1)
else:
    print(num) a = input('') a input('') input '' S = [] S [] num = 0 num 0 for i in a:
    S.append(i) i a S.append(i) S.append S append i for j in range(3):
    if S[j] == 'R':
        num += 1 j range(3) range 3 if S[j] == 'R':
        num += 1 S[j] == 'R' S[j] S j 'R' num += 1 num 1 if num == 2 and S[1] == 'S':
    print(1)
else:
    print(num) num == 2 and S[1] == 'S' num == 2 num 2 S[1] == 'S' S[1] S 1 'S' print(1) print 1 print(num) print num S = [] [] S num += 1 1 num a = input('') input('') a num = 0 0 num
a = input('')
S = []
num = 0
for i in a:
    S.append(i)
for j in range(3):
    if S[j] == 'R':
        num += 1
if num == 2 and S[1] == 'S':
    print(1)
else:
    print(num)