S = input()
 
a = (S[0] == 'R')
b = (S[1] == 'R')
c = (S[2] == 'R')
 
if a and b and c:
  print(3)
elif (a and b and (c == False)) or ((a == False) and b and c):
  print(2)
elif (a == False) and (b == False) and (c == False):
  print(0)
else:
  print(1) S = input() S input() input a = (S[0] == 'R') a S[0] == 'R' S[0] S 0 'R' b = (S[1] == 'R') b S[1] == 'R' S[1] S 1 'R' c = (S[2] == 'R') c S[2] == 'R' S[2] S 2 'R' if a and b and c:
  print(3)
elif (a and b and (c == False)) or ((a == False) and b and c):
  print(2)
elif (a == False) and (b == False) and (c == False):
  print(0)
else:
  print(1) a and b and c a and b a b c print(3) print 3 elif (a and b and (c == False)) or ((a == False) and b and c):
  print(2) (a and b and (c == False)) or ((a == False) and b and c) a and b and (c == False) a and b a b c == False c False (a == False) and b and c (a == False) and b a == False a False b c print(2) print 2 elif (a == False) and (b == False) and (c == False):
  print(0) (a == False) and (b == False) and (c == False) (a == False) and (b == False) a == False a False b == False b False c == False c False print(0) print 0 print(1) print 1 S = input() input() S b = (S[1] == 'R') S[1] == 'R' b c = (S[2] == 'R') S[2] == 'R' c a = (S[0] == 'R') S[0] == 'R' a
S = input()
 
a = (S[0] == 'R')
b = (S[1] == 'R')
c = (S[2] == 'R')
 
if a and b and c:
  print(3)
elif (a and b and (c == False)) or ((a == False) and b and c):
  print(2)
elif (a == False) and (b == False) and (c == False):
  print(0)
else:
  print(1)