s = input()
count = 0
for i in range(len(s)):
  if s[i] == "R":
    count += 1
    if i + 1 >= 3:
      break
    elif s[i+1] == "S":
      break
print(count) s = input() s input() input count = 0 count 0 for i in range(len(s)):
  if s[i] == "R":
    count += 1
    if i + 1 >= 3:
      break
    elif s[i+1] == "S":
      break i range(len(s)) range len(s) len s if s[i] == "R":
    count += 1
    if i + 1 >= 3:
      break
    elif s[i+1] == "S":
      break s[i] == "R" s[i] s i "R" count += 1 count 1 if i + 1 >= 3:
      break
    elif s[i+1] == "S":
      break i + 1 >= 3 i + 1 i 1 3 break elif s[i+1] == "S":
      break s[i+1] == "S" s[i+1] s i+1 i 1 "S" break print(count) print count s = input() input() s count = 0 0 count count += 1 1 count
s = input()
count = 0
for i in range(len(s)):
  if s[i] == "R":
    count += 1
    if i + 1 >= 3:
      break
    elif s[i+1] == "S":
      break
print(count)