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