str = input()
s = str.count('R')

if s==0:
  print(0)
elif s == 1:
  print(1)
elif s == 2:
  if str == 'RRS' or str == 'SRR':
    print(2)
  else:
    print(1)
else:
  print(3) str = input() str input() input s = str.count('R') s str.count('R') str.count str count 'R' if s==0:
  print(0)
elif s == 1:
  print(1)
elif s == 2:
  if str == 'RRS' or str == 'SRR':
    print(2)
  else:
    print(1)
else:
  print(3) s==0 s 0 print(0) print 0 elif s == 1:
  print(1) s == 1 s 1 print(1) print 1 elif s == 2:
  if str == 'RRS' or str == 'SRR':
    print(2)
  else:
    print(1) s == 2 s 2 if str == 'RRS' or str == 'SRR':
    print(2)
  else:
    print(1) str == 'RRS' or str == 'SRR' str == 'RRS' str 'RRS' str == 'SRR' str 'SRR' print(2) print 2 print(1) print 1 print(3) print 3 s = str.count('R') str.count('R') s str = input() input() str
str = input()
s = str.count('R')

if s==0:
  print(0)
elif s == 1:
  print(1)
elif s == 2:
  if str == 'RRS' or str == 'SRR':
    print(2)
  else:
    print(1)
else:
  print(3)