str = str(input())
if str == "RRR":
  print(3)
elif str == "RRS" or str=="SRR":
  print(2)
elif str == "SSS":
  print(0)
else:
  print(1)

 str = str(input()) str str(input()) str input() input if str == "RRR":
  print(3)
elif str == "RRS" or str=="SRR":
  print(2)
elif str == "SSS":
  print(0)
else:
  print(1) str == "RRR" str "RRR" print(3) print 3 elif str == "RRS" or str=="SRR":
  print(2) str == "RRS" or str=="SRR" str == "RRS" str "RRS" str=="SRR" str "SRR" print(2) print 2 elif str == "SSS":
  print(0) str == "SSS" str "SSS" print(0) print 0 print(1) print 1 str = str(input()) str(input()) str
str = str(input())
if str == "RRR":
  print(3)
elif str == "RRS" or str=="SRR":
  print(2)
elif str == "SSS":
  print(0)
else:
  print(1)


