s=input()
 
if s in ["RRR"]:
  print(3)
elif s in ["RRS","SRR"]:
  print(2)
elif s in ["RSS","SRS","SSR","RSR"]:
  print(1)
else:
  print(0) s=input() s input() input if s in ["RRR"]:
  print(3)
elif s in ["RRS","SRR"]:
  print(2)
elif s in ["RSS","SRS","SSR","RSR"]:
  print(1)
else:
  print(0) s in ["RRR"] s ["RRR"] "RRR" print(3) print 3 elif s in ["RRS","SRR"]:
  print(2) s in ["RRS","SRR"] s ["RRS","SRR"] "RRS" "SRR" print(2) print 2 elif s in ["RSS","SRS","SSR","RSR"]:
  print(1) s in ["RSS","SRS","SSR","RSR"] s ["RSS","SRS","SSR","RSR"] "RSS" "SRS" "SSR" "RSR" print(1) print 1 print(0) print 0 s=input() input() s
s=input()
 
if s in ["RRR"]:
  print(3)
elif s in ["RRS","SRR"]:
  print(2)
elif s in ["RSS","SRS","SSR","RSR"]:
  print(1)
else:
  print(0)