N = int(input())
c = input()

R_r = c.count("R")
W_l = 0
ans = N
for i in range(N+1):
  t = max(R_r,W_l)
  ans = min(ans, t)
  if R_r == 0:
    break
  if c[i] == "R":
    R_r -= 1
  else:
    W_l += 1

print(ans) N = int(input()) N int(input()) int input() input c = input() c input() input R_r = c.count("R") R_r c.count("R") c.count c count "R" W_l = 0 W_l 0 ans = N ans N for i in range(N+1):
  t = max(R_r,W_l)
  ans = min(ans, t)
  if R_r == 0:
    break
  if c[i] == "R":
    R_r -= 1
  else:
    W_l += 1 i range(N+1) range N+1 N 1 t = max(R_r,W_l) t max(R_r,W_l) max R_r W_l ans = min(ans, t) ans min(ans, t) min ans t if R_r == 0:
    break
   R_r == 0 R_r 0 break if c[i] == "R":
    R_r -= 1
  else:
    W_l += 1 c[i] == "R" c[i] c i "R" R_r -= 1 R_r 1 W_l += 1 W_l 1 print(ans) print ans c = input() input() c R_r -= 1 1 R_r W_l += 1 1 W_l ans = N N ans t = max(R_r,W_l) max(R_r,W_l) t W_l = 0 0 W_l ans = min(ans, t) min(ans, t) ans N = int(input()) int(input()) N R_r = c.count("R") c.count("R") R_r
N = int(input())
c = input()

R_r = c.count("R")
W_l = 0
ans = N
for i in range(N+1):
  t = max(R_r,W_l)
  ans = min(ans, t)
  if R_r == 0:
    break
  if c[i] == "R":
    R_r -= 1
  else:
    W_l += 1

print(ans)