N = int(input())
C = list(input())

W = C.count("W")
R = C.count("R")
w = 0
r = R

ans = R
for i in range(1,N+1):
  if C[i-1] == "W":
    w += 1
  else:
    r -= 1
  ans = min(ans, max(w,r))
  
print(ans) N = int(input()) N int(input()) int input() input C = list(input()) C list(input()) list input() input W = C.count("W") W C.count("W") C.count C count "W" R = C.count("R") R C.count("R") C.count C count "R" w = 0 w 0 r = R r R ans = R ans R for i in range(1,N+1):
  if C[i-1] == "W":
    w += 1
  else:
    r -= 1
  ans = min(ans, max(w,r))
   i range(1,N+1) range 1 N+1 N 1 if C[i-1] == "W":
    w += 1
  else:
    r -= 1
   C[i-1] == "W" C[i-1] C i-1 i 1 "W" w += 1 w 1 r -= 1 r 1 ans = min(ans, max(w,r)) ans min(ans, max(w,r)) min ans max(w,r) max w r print(ans) print ans r -= 1 1 r ans = R R ans w += 1 1 w N = int(input()) int(input()) N W = C.count("W") C.count("W") W w = 0 0 w r = R R r ans = min(ans, max(w,r)) min(ans, max(w,r)) ans R = C.count("R") C.count("R") R C = list(input()) list(input()) C
N = int(input())
C = list(input())

W = C.count("W")
R = C.count("R")
w = 0
r = R

ans = R
for i in range(1,N+1):
  if C[i-1] == "W":
    w += 1
  else:
    r -= 1
  ans = min(ans, max(w,r))
  
print(ans)