s = input()
c = 0
for i in range(3):
  if s[i] == "R":
    c += 1
if c == 2:
  if s[1] == "S":
    print(1)
  else:
    print(2)
else:
  print(c) s = input() s input() input c = 0 c 0 for i in range(3):
  if s[i] == "R":
    c += 1 i range(3) range 3 if s[i] == "R":
    c += 1 s[i] == "R" s[i] s i "R" c += 1 c 1 if c == 2:
  if s[1] == "S":
    print(1)
  else:
    print(2)
else:
  print(c) c == 2 c 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 print(c) print c s = input() input() s c = 0 0 c c += 1 1 c
s = input()
c = 0
for i in range(3):
  if s[i] == "R":
    c += 1
if c == 2:
  if s[1] == "S":
    print(1)
  else:
    print(2)
else:
  print(c)