n = int(input())
c = input()

#右端から見ていって初めのRが出たらWとRをカウントする
cnt = 0
R = 0
W = 0

for i in range(n):
    if c[i] == "R":R += 1
    else:W += 1

for i in range(R):
    if c[i] == "W":cnt += 1
print(cnt) n = int(input()) n int(input()) int input() input c = input() c input() input cnt = 0 cnt 0 R = 0 R 0 W = 0 W 0 for i in range(n):
    if c[i] == "R":R += 1
    else:W += 1 i range(n) range n if c[i] == "R":R += 1
    else:W += 1 c[i] == "R" c[i] c i "R" for i in range(R):
    if c[i] == "W":cnt += 1 i range(R) range R if c[i] == "W":cnt  c[i] == "W" c[i] c i "W" print(cnt) print cnt R = 0 0 R cnt = 0 0 cnt c = input() input() c W = 0 0 W n = int(input()) int(input()) n
n = int(input())
c = input()

#右端から見ていって初めのRが出たらWとRをカウントする
cnt = 0
R = 0
W = 0

for i in range(n):
    if c[i] == "R":R += 1
    else:W += 1

for i in range(R):
    if c[i] == "W":cnt += 1
print(cnt)