n = int(input())
S = input()

r = S.count('R')
w = 0

ans = r
for i in range(n):
    if S[i] == "W":
        w += 1
    elif S[i] == "R":
        r -= 1
    ans = min(ans,max(r,w))
print(ans) n = int(input()) n int(input()) int input() input S = input() S input() input r = S.count('R') r S.count('R') S.count S count 'R' w = 0 w 0 ans = r ans r for i in range(n):
    if S[i] == "W":
        w += 1
    elif S[i] == "R":
        r -= 1
    ans = min(ans,max(r,w)) i range(n) range n if S[i] == "W":
        w += 1
    elif S[i] == "R":
        r -= 1
     S[i] == "W" S[i] S i "W" w += 1 w 1 elif S[i] == "R":
        r -= 1
     S[i] == "R" S[i] S i "R" r -= 1 r 1 ans = min(ans,max(r,w)) ans min(ans,max(r,w)) min ans max(r,w) max r w print(ans) print ans w = 0 0 w ans = r r ans r -= 1 1 r ans = min(ans,max(r,w)) min(ans,max(r,w)) ans r = S.count('R') S.count('R') r S = input() input() S n = int(input()) int(input()) n w += 1 1 w
n = int(input())
S = input()

r = S.count('R')
w = 0

ans = r
for i in range(n):
    if S[i] == "W":
        w += 1
    elif S[i] == "R":
        r -= 1
    ans = min(ans,max(r,w))
print(ans)