from collections import Counter
n = int(input())
c = list(input())
num = Counter(c)
r = num["R"]

ans = ["R"]*r + ["W"]*(n-r)
cnt = 0

for i in range(n):
    if c[i] != ans[i]:
        cnt += 1
        
print(cnt//2)
 from collections import Counter n = int(input()) n int(input()) int input() input c = list(input()) c list(input()) list input() input num = Counter(c) num Counter(c) Counter c r = num["R"] r num["R"] num "R" ans = ["R"]*r + ["W"]*(n-r) ans ["R"]*r + ["W"]*(n-r) ["R"]*r ["R"] "R" r ["W"]*(n-r) ["W"] "W" n-r n r cnt = 0 cnt 0 for i in range(n):
    if c[i] != ans[i]:
        cnt += 1
         i range(n) range n if c[i] != ans[i]:
        cnt += 1
         c[i] != ans[i] c[i] c i ans[i] ans i cnt += 1 cnt 1 print(cnt//2) print cnt//2 cnt 2 n = int(input()) int(input()) n cnt += 1 1 cnt c = list(input()) list(input()) c ans = ["R"]*r + ["W"]*(n-r) ["R"]*r + ["W"]*(n-r) ans r = num["R"] num["R"] r num = Counter(c) Counter(c) num cnt = 0 0 cnt
from collections import Counter
n = int(input())
c = list(input())
num = Counter(c)
r = num["R"]

ans = ["R"]*r + ["W"]*(n-r)
cnt = 0

for i in range(n):
    if c[i] != ans[i]:
        cnt += 1
        
print(cnt//2)

