N = int(input())
C = list(input())
count = list()
W = 0
R = 0

for i in C:
    if i == "R":
        R += 1

if R == 0:
    count.append(0)

for i in C:

    if i == "W":
        W += 1
    else:
        R -= 1

    if W <= R:
        count.append(R)
    else:
        count.append(W)

print(min(count)) N = int(input()) N int(input()) int input() input C = list(input()) C list(input()) list input() input count = list() count list() list W = 0 W 0 R = 0 R 0 for i in C:
    if i == "R":
        R += 1 i C if i == "R":
        R += 1 i == "R" i "R" R += 1 R 1 if R == 0:
    count.append(0) R == 0 R 0 count.append(0) count.append count append 0 for i in C:

    if i == "W":
        W += 1
    else:
        R -= 1

    if W <= R:
        count.append(R)
    else:
        count.append(W) i C if i == "W":
        W += 1
    else:
        R -= 1

     i == "W" i "W" W += 1 W 1 R -= 1 R 1 if W <= R:
        count.append(R)
    else:
        count.append(W) W <= R W R count.append(R) count.append count append R count.append(W) count.append count append W print(min(count)) print min(count) min count W = 0 0 W count = list() list() count N = int(input()) int(input()) N C = list(input()) list(input()) C R += 1 1 R W += 1 1 W R -= 1 1 R R = 0 0 R
N = int(input())
C = list(input())
count = list()
W = 0
R = 0

for i in C:
    if i == "R":
        R += 1

if R == 0:
    count.append(0)

for i in C:

    if i == "W":
        W += 1
    else:
        R -= 1

    if W <= R:
        count.append(R)
    else:
        count.append(W)

print(min(count))