S = input()
a = 0
for i in range(3):
  if S[i]=="R":
    a+=1
  if S[i]=="S" and a>0:
      break
print(a) S = input() S input() input a = 0 a 0 for i in range(3):
  if S[i]=="R":
    a+=1
  if S[i]=="S" and a>0:
      break i range(3) range 3 if S[i]=="R":
    a+=1
   S[i]=="R" S[i] S i "R" a+=1 a 1 if S[i]=="S" and a>0:
      break S[i]=="S" and a>0 S[i]=="S" S[i] S i "S" a>0 a 0 break print(a) print a S = input() input() S a+=1 1 a a = 0 0 a
S = input()
a = 0
for i in range(3):
  if S[i]=="R":
    a+=1
  if S[i]=="S" and a>0:
      break
print(a)