S = input()
 
ans = 0
if S == 'RRR': ans = 3
else:
  if ('RR' in S): ans = 2
  else:
    if('R' in S): ans = 1
    else: ans = 0
 
print(ans) S = input() S input() input ans = 0 ans 0 if S == 'RRR': ans = 3
else:
  if ('RR' in S): ans = 2
  else:
    if('R' in S): ans = 1
    else: ans = 0
  S == 'RRR' S 'RRR' if ('RR' in S): ans = 2
  else:
    if('R' in S): ans = 1
    else: ans = 0
  'RR' in S 'RR' S if('R' in S): ans = 1
    else: ans = 0
  'R' in S 'R' S print(ans) print ans ans = 0 0 ans S = input() input() S
S = input()
 
ans = 0
if S == 'RRR': ans = 3
else:
  if ('RR' in S): ans = 2
  else:
    if('R' in S): ans = 1
    else: ans = 0
 
print(ans)