N=int(input())

c=list(input())

minimum=len(c)
W=0
R=c.count('R')

for i in range(0,len(c)):
    if c[i]=='W':
        W += 1
    else :
        R -= 1
    min_i=max(W,R)
    if min_i < minimum:
        minimum=min_i

if c.count('R')==0:
    minimum=0

print(minimum) N=int(input()) N int(input()) int input() input c=list(input()) c list(input()) list input() input minimum=len(c) minimum len(c) len c W=0 W 0 R=c.count('R') R c.count('R') c.count c count 'R' for i in range(0,len(c)):
    if c[i]=='W':
        W += 1
    else :
        R -= 1
    min_i=max(W,R)
    if min_i < minimum:
        minimum=min_i i range(0,len(c)) range 0 len(c) len c if c[i]=='W':
        W += 1
    else :
        R -= 1
     c[i]=='W' c[i] c i 'W' W += 1 W 1 R -= 1 R 1 min_i=max(W,R) min_i max(W,R) max W R if min_i < minimum:
        minimum=min_i min_i < minimum min_i minimum minimum=min_i minimum min_i if c.count('R')==0:
    minimum=0 c.count('R')==0 c.count('R') c.count c count 'R' 0 minimum=0 minimum 0 print(minimum) print minimum minimum=0 0 minimum R=c.count('R') c.count('R') R W += 1 1 W N=int(input()) int(input()) N minimum=len(c) len(c) minimum W=0 0 W min_i=max(W,R) max(W,R) min_i R -= 1 1 R minimum=min_i min_i minimum c=list(input()) list(input()) c
N=int(input())

c=list(input())

minimum=len(c)
W=0
R=c.count('R')

for i in range(0,len(c)):
    if c[i]=='W':
        W += 1
    else :
        R -= 1
    min_i=max(W,R)
    if min_i < minimum:
        minimum=min_i

if c.count('R')==0:
    minimum=0

print(minimum)