import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**6)

n=int(input().rstrip())
c=input().rstrip()
w,r=0,0
for i in c:
    if i=="R":r+=1
    else:w+=1
ans=0
for i in range(r):
    if c[i]=="W":ans+=1
print(ans) import sys sys input=sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline sys.setrecursionlimit(10**6) sys.setrecursionlimit sys setrecursionlimit 10**6 10 6 n=int(input().rstrip()) n int(input().rstrip()) int input().rstrip() ().rstrip () input rstrip c=input().rstrip() c input().rstrip() ().rstrip () input rstrip w,r=0,0 w 0 r 0 for i in c:
    if i=="R":r+=1
    else:w+=1 i c if i=="R":r+=1
    else:w+=1 i=="R" i "R" ans=0 ans 0 for i in range(r):
    if c[i]=="W":ans+=1 i range(r) range r if c[i]=="W":an c[i]=="W" c[i] c i "W" print(ans) print ans input=sys.stdin.readline sys.stdin.readline input w,r=0,0 0 w r=0,0 0 r ans=0 0 ans n=int(input().rstrip()) int(input().rstrip()) n c=input().rstrip() input().rstrip() c
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**6)

n=int(input().rstrip())
c=input().rstrip()
w,r=0,0
for i in c:
    if i=="R":r+=1
    else:w+=1
ans=0
for i in range(r):
    if c[i]=="W":ans+=1
print(ans)