S=input()
if ("R" in S) and ("RR" not in S) and ("RRR" not in S):
  print(1)
elif ("RR" in S) and ("RRR" not in S):
  print(2)
elif ("RRR" in S):
  print(3)
else:
  print(0) S=input() S input() input if ("R" in S) and ("RR" not in S) and ("RRR" not in S):
  print(1)
elif ("RR" in S) and ("RRR" not in S):
  print(2)
elif ("RRR" in S):
  print(3)
else:
  print(0) ("R" in S) and ("RR" not in S) and ("RRR" not in S) ("R" in S) and ("RR" not in S) "R" in S "R" S "RR" not in S "RR" S "RRR" not in S "RRR" S print(1) print 1 elif ("RR" in S) and ("RRR" not in S):
  print(2) ("RR" in S) and ("RRR" not in S) "RR" in S "RR" S "RRR" not in S "RRR" S print(2) print 2 elif ("RRR" in S):
  print(3) "RRR" in S "RRR" S print(3) print 3 print(0) print 0 S=input() input() S
S=input()
if ("R" in S) and ("RR" not in S) and ("RRR" not in S):
  print(1)
elif ("RR" in S) and ("RRR" not in S):
  print(2)
elif ("RRR" in S):
  print(3)
else:
  print(0)