s = str(input())

cnt = s.count("R")

if cnt == 0:
  print(0)
elif cnt == 1:
  print(1)
elif cnt == 2:
  if s[1] == "S":
    print(1)
  else:
    print(2)
elif cnt == 3:
  print(3) s = str(input()) s str(input()) str input() input cnt = s.count("R") cnt s.count("R") s.count s count "R" if cnt == 0:
  print(0)
elif cnt == 1:
  print(1)
elif cnt == 2:
  if s[1] == "S":
    print(1)
  else:
    print(2)
elif cnt == 3:
  print(3) cnt == 0 cnt 0 print(0) print 0 elif cnt == 1:
  print(1) cnt == 1 cnt 1 print(1) print 1 elif cnt == 2:
  if s[1] == "S":
    print(1)
  else:
    print(2) cnt == 2 cnt 2 if s[1] == "S":
    print(1)
  else:
    print(2) s[1] == "S" s[1] s 1 "S" print(1) print 1 print(2) print 2 elif cnt == 3:
  print(3) cnt == 3 cnt 3 print(3) print 3 s = str(input()) str(input()) s cnt = s.count("R") s.count("R") cnt
s = str(input())

cnt = s.count("R")

if cnt == 0:
  print(0)
elif cnt == 1:
  print(1)
elif cnt == 2:
  if s[1] == "S":
    print(1)
  else:
    print(2)
elif cnt == 3:
  print(3)