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

print(ans)
