s=str(input())
if s.count("RRR")==1:
  print(3)
elif s.count("RR")==1:
  print(2)
elif s.count("R")>=1:
  print(1)
else:
  print(0) s=str(input()) s str(input()) str input() input if s.count("RRR")==1:
  print(3)
elif s.count("RR")==1:
  print(2)
elif s.count("R")>=1:
  print(1)
else:
  print(0) s.count("RRR")==1 s.count("RRR") s.count s count "RRR" 1 print(3) print 3 elif s.count("RR")==1:
  print(2) s.count("RR")==1 s.count("RR") s.count s count "RR" 1 print(2) print 2 elif s.count("R")>=1:
  print(1) s.count("R")>=1 s.count("R") s.count s count "R" 1 print(1) print 1 print(0) print 0 s=str(input()) str(input()) s
s=str(input())
if s.count("RRR")==1:
  print(3)
elif s.count("RR")==1:
  print(2)
elif s.count("R")>=1:
  print(1)
else:
  print(0)