n = int(eval(input()))

c = list(eval(input()))

r = c.count('R')

w = c.count('W')

ans = 0



for i in range(r):

    if c[i] == 'R':

        pass

    elif c[i] == 'W':

        ans += 1

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

c = list(eval(input()))

r = c.count('R')

ans = 0



for i in range(r):

    if c[i] == 'W':

        ans += 1

print(ans)
n = int(eval(input()))
c = list(eval(input()))
r = c.count("R")
w = c.count("W")
ans = 0
for i in range(r):
    if c[i] == "R":
        pass
    elif c[i] == "W":
        ans += 1
print(ans)

n = int(eval(input()))
c = list(eval(input()))
r = c.count("R")
ans = 0
for i in range(r):
    if c[i] == "W":
        ans += 1
print(ans)

-w = c.count("W") -    if c[i] == "R": -        pass -    elif c[i] == "W": +    if c[i] == "W":