N = int(input())
c = input()
W = 0
R = c.count('R')
if R == 0 or R == N:
  print(0)
  exit()
ans = N
t = 0
for i in range(N):
  if c[i] == 'W':
    W += 1
  else:
    R -= 1
  t = max(R,W)
  ans = min(ans, t)
print(ans) 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 R == 0 or R == N:
  print(0)
  exit() R == 0 or R == N R == 0 R 0 R == N R N print(0) print 0 exit() exit ans = N ans N t = 0 t 0 for i in range(N):
  if c[i] == 'W':
    W += 1
  else:
    R -= 1
  t = max(R,W)
  ans = min(ans, t) i range(N) range N if c[i] == 'W':
    W += 1
  else:
    R -= 1
   c[i] == 'W' c[i] c i 'W' W += 1 W 1 R -= 1 R 1 t = max(R,W) t max(R,W) max R W ans = min(ans, t) ans min(ans, t) min ans t print(ans) print ans t = max(R,W) max(R,W) t W += 1 1 W ans = N N ans c = input() input() c W = 0 0 W R = c.count('R') c.count('R') R N = int(input()) int(input()) N t = 0 0 t R -= 1 1 R ans = min(ans, t) min(ans, t) ans
N = int(input())
c = input()
W = 0
R = c.count('R')
if R == 0 or R == N:
  print(0)
  exit()
ans = N
t = 0
for i in range(N):
  if c[i] == 'W':
    W += 1
  else:
    R -= 1
  t = max(R,W)
  ans = min(ans, t)
print(ans)