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