import sys
input = sys.stdin.readline

#n = int(input())
#l = list(map(int, input().split()))

'''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)   
    b.append(B)'''

n=int(input())
c=list(input().rstrip("\n"))
import collections
cc=collections.Counter(c)
ans=0
for i in range(cc["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 '''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)   
    b.append(B)''' n=int(input()) n int(input()) int input() input c=list(input().rstrip("\n")) c list(input().rstrip("\n")) list input().rstrip("\n") ().rstrip () input rstrip "\n" import collections collections cc=collections.Counter(c) cc collections.Counter(c) collections.Counter collections Counter c ans=0 ans 0 for i in range(cc["R"]):
    if c[i]=="W":
        ans+=1 i range(cc["R"]) range cc["R"] cc "R" if c[i]=="W":
        ans+=1 c[i]=="W" c[i] c i "W" ans+=1 ans 1 print(ans) print ans ans+=1 1 ans c=list(input().rstrip("\n")) list(input().rstrip("\n")) c ans=0 0 ans input = sys.stdin.readline sys.stdin.readline input n=int(input()) int(input()) n cc=collections.Counter(c) collections.Counter(c) cc
import sys
input = sys.stdin.readline

#n = int(input())
#l = list(map(int, input().split()))

'''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)   
    b.append(B)'''

n=int(input())
c=list(input().rstrip("\n"))
import collections
cc=collections.Counter(c)
ans=0
for i in range(cc["R"]):
    if c[i]=="W":
        ans+=1
print(ans)