n=int(input())
c=list(input())
numW=0
numR=c.count("R")
W=n-numR
a=[]
if numR==0 or W==0:
    print(0)
else:
    for i in range(n):
        if c[i]=="W":
            numW+=1
        else:
            numR-=1
        a.append(max(numR,numW))
    print(min(a)) n=int(input()) n int(input()) int input() input c=list(input()) c list(input()) list input() input numW=0 numW 0 numR=c.count("R") numR c.count("R") c.count c count "R" W=n-numR W n-numR n numR a=[] a [] if numR==0 or W==0:
    print(0)
else:
    for i in range(n):
        if c[i]=="W":
            numW+=1
        else:
            numR-=1
        a.append(max(numR,numW))
    print(min(a)) numR==0 or W==0 numR==0 numR 0 W==0 W 0 print(0) print 0 for i in range(n):
        if c[i]=="W":
            numW+=1
        else:
            numR-=1
        a.append(max(numR,numW))
     i range(n) range n if c[i]=="W":
            numW+=1
        else:
            numR-=1
         c[i]=="W" c[i] c i "W" numW+=1 numW 1 numR-=1 numR 1 a.append(max(numR,numW)) a.append a append max(numR,numW) max numR numW print(min(a)) print min(a) min a W=n-numR n-numR W n=int(input()) int(input()) n a=[] [] a numR-=1 1 numR numW+=1 1 numW numW=0 0 numW numR=c.count("R") c.count("R") numR c=list(input()) list(input()) c
n=int(input())
c=list(input())
numW=0
numR=c.count("R")
W=n-numR
a=[]
if numR==0 or W==0:
    print(0)
else:
    for i in range(n):
        if c[i]=="W":
            numW+=1
        else:
            numR-=1
        a.append(max(numR,numW))
    print(min(a))