N = int(eval(input()))

c = list(eval(input()))

ans = 0

FLG = False

j = N - 1

for i, color in enumerate(c):

    if color == "W":

        while c[j] == "W":

            j -= 1

            if j <= i:

                FLG = True

                break

        if FLG:

            break

        ans += 1

        c[i], c[j] = c[j], c[i]



print(ans)
N = int(eval(input()))

c = eval(input())

x = c.count("R")

print((c[x:].count("R")))

N = int(eval(input()))
c = list(eval(input()))
ans = 0
FLG = False
j = N - 1
for i, color in enumerate(c):
    if color == "W":
        while c[j] == "W":
            j -= 1
            if j <= i:
                FLG = True
                break
        if FLG:
            break
        ans += 1
        c[i], c[j] = c[j], c[i]
print(ans)

N = int(eval(input()))
c = eval(input())
x = c.count("R")
print((c[x:].count("R")))

-c = list(eval(input())) -ans = 0 -FLG = False -j = N - 1 -for i, color in enumerate(c): -    if color == "W": -        while c[j] == "W": -            j -= 1 -            if j <= i: -                FLG = True -                break -        if FLG: -            break -        ans += 1 -        c[i], c[j] = c[j], c[i] -print(ans) +c = eval(input()) +x = c.count("R") +print((c[x:].count("R")))