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

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

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