n = int(input())
c = list(input())

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

w = 0
r = c.count('R')
ans = max(w, r)
for i in range(n):
    if c[i] == 'W':
        w += 1
    else:
        r -= 1
    ans = min(ans, max(w, r))
print(ans)
