from collections import Counter





N = int(eval(input()))

C = eval(input())

C_cntr = Counter(C)



all_R_cnt = 0

all_W_cnt = 0

R_W_cnt = 0

for i in range(N):

    if C[i] == "W":

        all_R_cnt += 1

    elif C[i] == "R":

        all_W_cnt += 1

    if i < C_cntr.get("R", 0) and C[i] == "W":

        R_W_cnt += 1



print((min(all_R_cnt, all_W_cnt, R_W_cnt)))

from collections import Counter





N = int(eval(input()))

C = eval(input())

C_cntr = Counter(C)



ans = 0

for i in range(C_cntr["R"]):

    if C[i] == "W":

        ans += 1



print(ans)

from collections import Counter

N = int(eval(input()))
C = eval(input())
C_cntr = Counter(C)
all_R_cnt = 0
all_W_cnt = 0
R_W_cnt = 0
for i in range(N):
    if C[i] == "W":
        all_R_cnt += 1
    elif C[i] == "R":
        all_W_cnt += 1
    if i < C_cntr.get("R", 0) and C[i] == "W":
        R_W_cnt += 1
print((min(all_R_cnt, all_W_cnt, R_W_cnt)))

from collections import Counter

N = int(eval(input()))
C = eval(input())
C_cntr = Counter(C)
ans = 0
for i in range(C_cntr["R"]):
    if C[i] == "W":
        ans += 1
print(ans)

-all_R_cnt = 0 -all_W_cnt = 0 -R_W_cnt = 0 -for i in range(N): +ans = 0 +for i in range(C_cntr["R"]): -        all_R_cnt += 1 -    elif C[i] == "R": -        all_W_cnt += 1 -    if i < C_cntr.get("R", 0) and C[i] == "W": -        R_W_cnt += 1 -print((min(all_R_cnt, all_W_cnt, R_W_cnt))) +        ans += 1 +print(ans)