N = int(input())
c = input()
W = 0
R = c.count("R")
if N == R or R == 0:
  print("0")
else:
  cnt = N
  for i in range(N):
    if c[i] == "W":
      W = W + 1
    else:
      R = R - 1
    m = max(W, R)
    if m < cnt:
      cnt = m
  print(cnt) N = int(input()) N int(input()) int input() input c = input() c input() input W = 0 W 0 R = c.count("R") R c.count("R") c.count c count "R" if N == R or R == 0:
  print("0")
else:
  cnt = N
  for i in range(N):
    if c[i] == "W":
      W = W + 1
    else:
      R = R - 1
    m = max(W, R)
    if m < cnt:
      cnt = m
  print(cnt) N == R or R == 0 N == R N R R == 0 R 0 print("0") print "0" cnt = N cnt N for i in range(N):
    if c[i] == "W":
      W = W + 1
    else:
      R = R - 1
    m = max(W, R)
    if m < cnt:
      cnt = m
   i range(N) range N if c[i] == "W":
      W = W + 1
    else:
      R = R - 1
     c[i] == "W" c[i] c i "W" W = W + 1 W W + 1 W 1 R = R - 1 R R - 1 R 1 m = max(W, R) m max(W, R) max W R if m < cnt:
      cnt = m
   m < cnt m cnt cnt = m cnt m print(cnt) print cnt R = R - 1 R - 1 R c = input() input() c cnt = N N cnt W = W + 1 W + 1 W m = max(W, R) max(W, R) m R = c.count("R") c.count("R") R N = int(input()) int(input()) N W = 0 0 W cnt = m m cnt
N = int(input())
c = input()
W = 0
R = c.count("R")
if N == R or R == 0:
  print("0")
else:
  cnt = N
  for i in range(N):
    if c[i] == "W":
      W = W + 1
    else:
      R = R - 1
    m = max(W, R)
    if m < cnt:
      cnt = m
  print(cnt)