S = input()
 
# 高々2^3=8通りなので、全て列挙すればよい
# RRR RRS SRR RSR RSS SRS SSR SSS
ans = 0
if S == 'RRR': ans = 3
elif S == 'SRR' or S == 'RRS': ans = 2
elif S == 'SSS': ans = 0
else: ans = 1
  
print(ans) S = input() S input() input ans = 0 ans 0 if S == 'RRR': ans = 3
elif S == 'SRR' or S == 'RRS': ans = 2
elif S == 'SSS': ans = 0
else: ans = 1
   S == 'RRR' S 'RRR' elif S == 'SRR' or S == 'RRS': ans = 2 S == 'SRR' or S == 'RRS' S == 'SRR' S 'SRR' S == 'RRS' S 'RRS' elif S == 'SSS': ans = 0 S == 'SSS' S 'SSS' print(ans) print ans ans = 0 0 ans S = input() input() S
S = input()
 
# 高々2^3=8通りなので、全て列挙すればよい
# RRR RRS SRR RSR RSS SRS SSR SSS
ans = 0
if S == 'RRR': ans = 3
elif S == 'SRR' or S == 'RRS': ans = 2
elif S == 'SSS': ans = 0
else: ans = 1
  
print(ans)