S = input()

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

if(S == 'RRR'):
  print(3)
elif(S=='RRS' or S=='SRR'):
  print(2)
elif(S == 'SSS'):
  print(0)
else:
  print(1)