S = input()

if 'RRR' in S: ANS = 3
elif 'RR' in S: ANS = 2
elif 'RS' in S: ANS = 1
elif 'SR' in S: ANS = 1
elif 'SSS' in S: ANS = 0

print(ANS) S = input() S input() input if 'RRR' in S: ANS = 3
elif 'RR' in S: ANS = 2
elif 'RS' in S: ANS = 1
elif 'SR' in S: ANS = 1
elif 'SSS' in S: ANS = 0 'RRR' in S 'RRR' S elif 'RR' in S: ANS = 2 'RR' in S 'RR' S elif 'RS' in S: ANS = 1 'RS' in S 'RS' S elif 'SR' in S: ANS = 1 'SR' in S 'SR' S elif 'SSS' in S: ANS = 0 'SSS' in S 'SSS' S print(ANS) print ANS S = input() input() S
S = input()

if 'RRR' in S: ANS = 3
elif 'RR' in S: ANS = 2
elif 'RS' in S: ANS = 1
elif 'SR' in S: ANS = 1
elif 'SSS' in S: ANS = 0

print(ANS)