n = int(input())
C = list(input())


W = C.count("W")
R = C.count("R")

# 仕切りより左側にある白石の数
w = 0
# 仕切りより右側にある赤石の数
r = R

ans = 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 = C.count("W") W C.count("W") C.count C count "W" R = C.count("R") R C.count("R") C.count C count "R" w = 0 w 0 r = R r R ans = r ans 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 w += 1 1 w ans = r r ans n = int(input()) int(input()) n ans = min(ans, max(w, r)) min(ans, max(w, r)) ans R = C.count("R") C.count("R") R r = R R r C = list(input()) list(input()) C W = C.count("W") C.count("W") W r -= 1 1 r
n = int(input())
C = list(input())


W = C.count("W")
R = C.count("R")

# 仕切りより左側にある白石の数
w = 0
# 仕切りより右側にある赤石の数
r = R

ans = r

for i in range(n):
    if C[i] == "W":
        w += 1
    else:
        r -= 1
    ans = min(ans, max(w, r))
print(ans)