n=int(eval(input()))

c=eval(input())



r=0

w=0



for i in range(n):

    if c[i]=="R":

        r+=1

    else:

        w+=1



umeru=0



for j in range(r):

    if c[j]=="W":

        umeru+=1



if r>=umeru:

    print(umeru)

else:

    print((umeru + (r-umeru)))
n=int(eval(input()))

c=eval(input())



r=0

w=0



for i in range(n):

    if c[i]=="R":

        r+=1

    else:

        w+=1



delete=0



for j in range(r):

    if c[j]=="W":

        delete+=1



if r>=delete:

    print(delete)

else:

    print((delete + (r-delete)))
n = int(eval(input()))
c = eval(input())
r = 0
w = 0
for i in range(n):
    if c[i] == "R":
        r += 1
    else:
        w += 1
umeru = 0
for j in range(r):
    if c[j] == "W":
        umeru += 1
if r >= umeru:
    print(umeru)
else:
    print((umeru + (r - umeru)))

n = int(eval(input()))
c = eval(input())
r = 0
w = 0
for i in range(n):
    if c[i] == "R":
        r += 1
    else:
        w += 1
delete = 0
for j in range(r):
    if c[j] == "W":
        delete += 1
if r >= delete:
    print(delete)
else:
    print((delete + (r - delete)))

-umeru = 0 +delete = 0 -        umeru += 1 -if r >= umeru: -    print(umeru) +        delete += 1 +if r >= delete: +    print(delete) -    print((umeru + (r - umeru))) +    print((delete + (r - delete)))