from collections import Counter

n = int(input())
s = input()

b = Counter(s)

ans = min(b["R"],b["W"])

a = 0
for i in range(b["R"]):
    if s[i] == "W":
        a += 1
        
print(min(ans,a)) from collections import Counter n = int(input()) n int(input()) int input() input s = input() s input() input b = Counter(s) b Counter(s) Counter s ans = min(b["R"],b["W"]) ans min(b["R"],b["W"]) min b["R"] b "R" b["W"] b "W" a = 0 a 0 for i in range(b["R"]):
    if s[i] == "W":
        a += 1
         i range(b["R"]) range b["R"] b "R" if s[i] == "W":
        a += 1
         s[i] == "W" s[i] s i "W" a += 1 a 1 print(min(ans,a)) print min(ans,a) min ans a b = Counter(s) Counter(s) b s = input() input() s ans = min(b["R"],b["W"]) min(b["R"],b["W"]) ans n = int(input()) int(input()) n a = 0 0 a a += 1 1 a
from collections import Counter

n = int(input())
s = input()

b = Counter(s)

ans = min(b["R"],b["W"])

a = 0
for i in range(b["R"]):
    if s[i] == "W":
        a += 1
        
print(min(ans,a))