n = int(input())
C = list(input())

if "R" not in C:
    print(0)
    exit()

W = C.count("W")
R = C.count("R")
w = 0
r = R
ans = float('inf')

for c in C:
    if c == "W":
        w += 1
    else:
        r -= 1
    ans = min(ans, max(w, r))
print(ans) n = int(input()) n int(input()) int input() input C = list(input()) C list(input()) list input() input if "R" not in C:
    print(0)
    exit() "R" not in C "R" C print(0) print 0 exit() exit W = C.count("W") W C.count("W") C.count C count "W" R = C.count("R") R C.count("R") C.count C count "R" w = 0 w 0 r = R r R ans = float('inf') ans float('inf') float 'inf' for c in C:
    if c == "W":
        w += 1
    else:
        r -= 1
    ans = min(ans, max(w, r)) c C if c == "W":
        w += 1
    else:
        r -= 1
     c == "W" c "W" w += 1 w 1 r -= 1 r 1 ans = min(ans, max(w, r)) ans min(ans, max(w, r)) min ans max(w, r) max w r print(ans) print ans W = C.count("W") C.count("W") W w += 1 1 w ans = float('inf') float('inf') ans r -= 1 1 r ans = min(ans, max(w, r)) min(ans, max(w, r)) ans C = list(input()) list(input()) C R = C.count("R") C.count("R") R n = int(input()) int(input()) n r = R R r w = 0 0 w
n = int(input())
C = list(input())

if "R" not in C:
    print(0)
    exit()

W = C.count("W")
R = C.count("R")
w = 0
r = R
ans = float('inf')

for c in C:
    if c == "W":
        w += 1
    else:
        r -= 1
    ans = min(ans, max(w, r))
print(ans)