N=int(input())
s=input()
A=[]
for i in range(N):
    A.append(s[i])

cntW=0
for i in range(N):
    if A[i]=="W":
        cntW+=1
cntR=N-cntW

changeW=0
changeR=0
for i in range(cntR):
    if A[i]=="W":
        changeW+=1
for i in range(cntR,N):
    if A[i]=="R":
        changeR+=1

if changeR==changeW:
    ans=changeW
else:
    #minN=min(changeW,changeR)
    maxN=max(changeR,changeW)
    ans=maxN
print(ans) N=int(input()) N int(input()) int input() input s=input() s input() input A=[] A [] for i in range(N):
    A.append(s[i]) i range(N) range N A.append(s[i]) A.append A append s[i] s i cntW=0 cntW 0 for i in range(N):
    if A[i]=="W":
        cntW+=1 i range(N) range N if A[i]=="W":
        cntW+=1 A[i]=="W" A[i] A i "W" cntW+=1 cntW 1 cntR=N-cntW cntR N-cntW N cntW changeW=0 changeW 0 changeR=0 changeR 0 for i in range(cntR):
    if A[i]=="W":
        changeW+=1 i range(cntR) range cntR if A[i]=="W":
        changeW+=1 A[i]=="W" A[i] A i "W" changeW+=1 changeW 1 for i in range(cntR,N):
    if A[i]=="R":
        changeR+=1 i range(cntR,N) range cntR N if A[i]=="R":
        changeR+=1 A[i]=="R" A[i] A i "R" changeR+=1 changeR 1 if changeR==changeW:
    ans=changeW
else:
    #minN=min(changeW,changeR)
    maxN=max(changeR,changeW)
    ans=maxN changeR==changeW changeR changeW ans=changeW ans changeW maxN=max(changeR,changeW) maxN max(changeR,changeW) max changeR changeW ans=maxN ans maxN print(ans) print ans changeR+=1 1 changeR cntR=N-cntW N-cntW cntR changeR=0 0 changeR ans=changeW changeW ans ans=maxN maxN ans cntW+=1 1 cntW changeW+=1 1 changeW maxN=max(changeR,changeW) max(changeR,changeW) maxN N=int(input()) int(input()) N changeW=0 0 changeW A=[] [] A cntW=0 0 cntW s=input() input() s
N=int(input())
s=input()
A=[]
for i in range(N):
    A.append(s[i])

cntW=0
for i in range(N):
    if A[i]=="W":
        cntW+=1
cntR=N-cntW

changeW=0
changeR=0
for i in range(cntR):
    if A[i]=="W":
        changeW+=1
for i in range(cntR,N):
    if A[i]=="R":
        changeR+=1

if changeR==changeW:
    ans=changeW
else:
    #minN=min(changeW,changeR)
    maxN=max(changeR,changeW)
    ans=maxN
print(ans)