n = int(input())
C = [x for x in str(input())]
cnt_R = C.count('R')
swap_W = C[:cnt_R].count('W')
ans = swap_W
print(ans) n = int(input()) n int(input()) int input() input x for x in str(input()) for x in str(input()) x str(input()) str input() input for x in str(input()) x C = [x for x in str(input())] C [x for x in str(input())] cnt_R = C.count('R') cnt_R C.count('R') C.count C count 'R' swap_W = C[:cnt_R].count('W') swap_W C[:cnt_R].count('W') [:cnt_R].count [:cnt_R] C :cnt_R cnt_R count 'W' ans = swap_W ans swap_W print(ans) print ans swap_W = C[:cnt_R].count('W') C[:cnt_R].count('W') swap_W n = int(input()) int(input()) n ans = swap_W swap_W ans cnt_R = C.count('R') C.count('R') cnt_R C = [x for x in str(input())] [x for x in str(input())] C
n = int(input())
C = [x for x in str(input())]
cnt_R = C.count('R')
swap_W = C[:cnt_R].count('W')
ans = swap_W
print(ans)