# -*- coding: utf-8 -*-
S = input()
ans = 0
for i in range(len(S)):
  if S[i] == "R":
    if ans == 0:
      ans += 1
    else:
      if i > 0 and S[i] == S[i-1] == "R":
        ans += 1
print(ans) S = input() S input() input ans = 0 ans 0 for i in range(len(S)):
  if S[i] == "R":
    if ans == 0:
      ans += 1
    else:
      if i > 0 and S[i] == S[i-1] == "R":
        ans += 1 i range(len(S)) range len(S) len S if S[i] == "R":
    if ans == 0:
      ans += 1
    else:
      if i > 0 and S[i] == S[i-1] == "R":
        ans += 1 S[i] == "R" S[i] S i "R" if ans == 0:
      ans += 1
    else:
      if i > 0 and S[i] == S[i-1] == "R":
        ans += 1 ans == 0 ans 0 ans += 1 ans 1 if i > 0 and S[i] == S[i-1] == "R":
        ans += 1 i > 0 and S[i] == S[i-1] == "R" i > 0 i 0 S[i] == S[i-1] == "R" S[i] == S[i-1] S[i] S i S[i-1] S i-1 i 1 "R" ans += 1 ans 1 print(ans) print ans ans += 1 1 ans ans += 1 1 ans S = input() input() S ans = 0 0 ans
# -*- coding: utf-8 -*-
S = input()
ans = 0
for i in range(len(S)):
  if S[i] == "R":
    if ans == 0:
      ans += 1
    else:
      if i > 0 and S[i] == S[i-1] == "R":
        ans += 1
print(ans)