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