S = input()

ans = 0
if S == "RSS" or S == "RSR" or S == "SRS" or S == "SSR":
  ans = 1
if S == "RRS" or S == "SRR":
  ans = 2
if S == "RRR":
  ans = 3

print(ans) S = input() S input() input ans = 0 ans 0 if S == "RSS" or S == "RSR" or S == "SRS" or S == "SSR":
  ans = 1 S == "RSS" or S == "RSR" or S == "SRS" or S == "SSR" S == "RSS" or S == "RSR" or S == "SRS" S == "RSS" or S == "RSR" S == "RSS" S "RSS" S == "RSR" S "RSR" S == "SRS" S "SRS" S == "SSR" S "SSR" ans = 1 ans 1 if S == "RRS" or S == "SRR":
  ans = 2 S == "RRS" or S == "SRR" S == "RRS" S "RRS" S == "SRR" S "SRR" ans = 2 ans 2 if S == "RRR":
  ans = 3 S == "RRR" S "RRR" ans = 3 ans 3 print(ans) print ans ans = 3 3 ans ans = 2 2 ans ans = 1 1 ans S = input() input() S ans = 0 0 ans
S = input()

ans = 0
if S == "RSS" or S == "RSR" or S == "SRS" or S == "SSR":
  ans = 1
if S == "RRS" or S == "SRR":
  ans = 2
if S == "RRR":
  ans = 3

print(ans)
