n = list(eval(input()))

n_r = len([i for i in n if i == "R"])



if n_r == 2:

  if n[1] == "S":

    print((1))

  else:

    print((2))

else:

  print(n_r)

S = eval(input())

R_check = lambda x: 1 if x=="R" else 0

rain_flg = list(map(R_check, S))

if sum(rain_flg) == 2:

  if rain_flg[1] == 0:

    print((1))

  else:

    print((2))

else:

  print((sum(rain_flg)))
n = list(eval(input()))
n_r = len([i for i in n if i == "R"])
if n_r == 2:
    if n[1] == "S":
        print((1))
    else:
        print((2))
else:
    print(n_r)

S = eval(input())
R_check = lambda x: 1 if x == "R" else 0
rain_flg = list(map(R_check, S))
if sum(rain_flg) == 2:
    if rain_flg[1] == 0:
        print((1))
    else:
        print((2))
else:
    print((sum(rain_flg)))

-n = list(eval(input())) -n_r = len([i for i in n if i == "R"]) -if n_r == 2: -    if n[1] == "S": +S = eval(input()) +R_check = lambda x: 1 if x == "R" else 0 +rain_flg = list(map(R_check, S)) +if sum(rain_flg) == 2: +    if rain_flg[1] == 0: -    print(n_r) +    print((sum(rain_flg)))