n = int(eval(input()))

c = list(eval(input()))

r = c.count('R')

r2 = c[:r].count('R')

print((r - r2))
n = int(eval(input()))

c = list(eval(input()))

r = c.count('R')

print((c[:r].count('W')))
n = int(eval(input()))
c = list(eval(input()))
r = c.count("R")
r2 = c[:r].count("R")
print((r - r2))

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

-r2 = c[:r].count("R") -print((r - r2)) +print((c[:r].count("W")))