s=input()

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

if (s=="RRR"):
  print(3)
elif (s=="SRR" or s=="RRS"):
  print(2)
elif (s=="SSR" or s=="RSS" or s=="SRS" or s=="RSR"):
  print(1)
else:
  print(0)