N=int(input())
s=input()

W=0
R=0
for i in range(N):
    if s[i]=='R':
        R+=1

count = R

for p in range(N):
    if s[p]=='R':
        R-=1
    elif s[p]=='W':
        W+=1
    if max(R, W) < count:
        count = max(R, W)

print(count) N=int(input()) N int(input()) int input() input s=input() s input() input W=0 W 0 R=0 R 0 for i in range(N):
    if s[i]=='R':
        R+=1 i range(N) range N if s[i]=='R':
        R+=1 s[i]=='R' s[i] s i 'R' R+=1 R 1 count = R count R for p in range(N):
    if s[p]=='R':
        R-=1
    elif s[p]=='W':
        W+=1
    if max(R, W) < count:
        count = max(R, W) p range(N) range N if s[p]=='R':
        R-=1
    elif s[p]=='W':
        W+=1
     s[p]=='R' s[p] s p 'R' R-=1 R 1 elif s[p]=='W':
        W+=1
     s[p]=='W' s[p] s p 'W' W+=1 W 1 if max(R, W) < count:
        count = max(R, W) max(R, W) < count max(R, W) max R W count count = max(R, W) count max(R, W) max R W print(count) print count R=0 0 R N=int(input()) int(input()) N s=input() input() s W+=1 1 W R+=1 1 R count = R R count count = max(R, W) max(R, W) count W=0 0 W R-=1 1 R
N=int(input())
s=input()

W=0
R=0
for i in range(N):
    if s[i]=='R':
        R+=1

count = R

for p in range(N):
    if s[p]=='R':
        R-=1
    elif s[p]=='W':
        W+=1
    if max(R, W) < count:
        count = max(R, W)

print(count)
