N=int(eval(input()))

c=list(str(eval(input())))

R=c.count('R')

W=c.count('W')

print((c[:R].count('W')))

N=int(eval(input()))

c=str(eval(input()))

R=c.count('R')

W=c[:R].count('W')

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

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

-c = list(str(eval(input()))) +c = str(eval(input())) -W = c.count("W") -print((c[:R].count("W"))) +W = c[:R].count("W") +print(W)