from collections import Counter
N=int(input())
C=list(input())

# RRRRWWWW ok
count=Counter(C)
ws=count["W"]
rs=count["R"]

outws=0
outrs=0
for i in range(N):
    c=C[i]
    if c=="R":
        if not 0<=i<rs:
            outrs+=1
    else:
        if 0<=i<rs:
            outws+=1

ans=max(outrs, outws)
print(ans) from collections import Counter N=int(input()) N int(input()) int input() input C=list(input()) C list(input()) list input() input count=Counter(C) count Counter(C) Counter C ws=count["W"] ws count["W"] count "W" rs=count["R"] rs count["R"] count "R" outws=0 outws 0 outrs=0 outrs 0 for i in range(N):
    c=C[i]
    if c=="R":
        if not 0<=i<rs:
            outrs+=1
    else:
        if 0<=i<rs:
            outws+=1 i range(N) range N c=C[i] c C[i] C i if c=="R":
        if not 0<=i<rs:
            outrs+=1
    else:
        if 0<=i<rs:
            outws+=1 c=="R" c "R" if not 0<=i<rs:
            outrs+=1
     not 0<=i<rs 0<=i<rs 0<=i 0 i rs outrs+=1 outrs 1 if 0<=i<rs:
            outws+=1 0<=i<rs 0<=i 0 i rs outws+=1 outws 1 ans=max(outrs, outws) ans max(outrs, outws) max outrs outws print(ans) print ans outws+=1 1 outws N=int(input()) int(input()) N ans=max(outrs, outws) max(outrs, outws) ans outrs+=1 1 outrs ws=count["W"] count["W"] ws outws=0 0 outws c=C[i] C[i] c rs=count["R"] count["R"] rs count=Counter(C) Counter(C) count C=list(input()) list(input()) C outrs=0 0 outrs
from collections import Counter
N=int(input())
C=list(input())

# RRRRWWWW ok
count=Counter(C)
ws=count["W"]
rs=count["R"]

outws=0
outrs=0
for i in range(N):
    c=C[i]
    if c=="R":
        if not 0<=i<rs:
            outrs+=1
    else:
        if 0<=i<rs:
            outws+=1

ans=max(outrs, outws)
print(ans)