N=int(input())
C=input()

n=0
c=0
for i in range(N)[::-1]:
    if C[i]=="R":
        while n<i:
            if C[n]=="W":
                c+=1
                n+=1
                break
            n+=1
print(c) N=int(input()) N int(input()) int input() input C=input() C input() input n=0 n 0 c=0 c 0 for i in range(N)[::-1]:
    if C[i]=="R":
        while n<i:
            if C[n]=="W":
                c+=1
                n+=1
                break
            n+=1 i range(N)[::-1] (N) range N ::-1 -1 if C[i]=="R":
        while n<i:
            if C[n]=="W":
                c+=1
                n+=1
                break
            n+=1 C[i]=="R" C[i] C i "R" while n<i:
            if C[n]=="W":
                c+=1
                n+=1
                break
            n+=1 n<i n i if C[n]=="W":
                c+=1
                n+=1
                break
             C[n]=="W" C[n] C n "W" c+=1 c 1 n+=1 n 1 break n+=1 n 1 print(c) print c n+=1 1 n N=int(input()) int(input()) N c+=1 1 c n=0 0 n n+=1 1 n C=input() input() C c=0 0 c
N=int(input())
C=input()

n=0
c=0
for i in range(N)[::-1]:
    if C[i]=="R":
        while n<i:
            if C[n]=="W":
                c+=1
                n+=1
                break
            n+=1
print(c)
