N=int(eval(input()))

c=eval(input())



rCount=0

for i in range(N):

  if c[i]=='R':

    rCount+=1

wCount=0



for i in range(rCount):

  if c[i]=='W':

    wCount+=1

print(wCount)

    
N=int(eval(input()))

c=eval(input())



rCount=c.count('R')

wCount=c[0:rCount].count('W')

print(wCount)
N = int(eval(input()))
c = eval(input())
rCount = 0
for i in range(N):
    if c[i] == "R":
        rCount += 1
wCount = 0
for i in range(rCount):
    if c[i] == "W":
        wCount += 1
print(wCount)

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

-rCount = 0 -for i in range(N): -    if c[i] == "R": -        rCount += 1 -wCount = 0 -for i in range(rCount): -    if c[i] == "W": -        wCount += 1 +rCount = c.count("R") +wCount = c[0:rCount].count("W")