#import re

N = input()
stones = input()
#pattern = 'W.*R'
#stoneslist =list(stones)
#result = re.search(pattern,stones)
#if result:
 # print (result.start())
  #print (result.end())
#print(stones[result.start()])
#stoneslist[result.start()]='R'
#stoneslist[result.end()-1]='W'

count =0
#while 'WR' in stones:
 # if stones.count('WR')>1:
  #  stoneslist =list(stones)
   # result = re.search(pattern,stones)
    #stoneslist[result.start()]='R'
    #stoneslist[result.end()-1]='W'
    #stones =str(stoneslist)
    #stones = "".join(stoneslist)
  #else:
   # stones = stones.replace('WR','RR',1)
  #count+=1
  #print(stones)

#print (stones)

red = 0
white = 0
for i in range(len(stones)):
  if stones[i] == "R":
    red +=1
for i in range(red):
  if stones[i] =='W':
    white+=1
print (white)
#print (count) N = input() N input() input stones = input() stones input() input count =0 count 0 red = 0 red 0 white = 0 white 0 for i in range(len(stones)):
  if stones[i] == "R":
    red +=1 i range(len(stones)) range len(stones) len stones if stones[i] == "R":
    red +=1 stones[i] == "R" stones[i] stones i "R" red +=1 red 1 for i in range(red):
  if stones[i] =='W':
    white+=1 i range(red) range red if stones[i] =='W':
    white+=1 stones[i] =='W' stones[i] stones i 'W' white+=1 white 1 print (white) print white count =0 0 count white = 0 0 white white+=1 1 white red = 0 0 red stones = input() input() stones N = input() input() N red +=1 1 red
#import re

N = input()
stones = input()
#pattern = 'W.*R'
#stoneslist =list(stones)
#result = re.search(pattern,stones)
#if result:
 # print (result.start())
  #print (result.end())
#print(stones[result.start()])
#stoneslist[result.start()]='R'
#stoneslist[result.end()-1]='W'

count =0
#while 'WR' in stones:
 # if stones.count('WR')>1:
  #  stoneslist =list(stones)
   # result = re.search(pattern,stones)
    #stoneslist[result.start()]='R'
    #stoneslist[result.end()-1]='W'
    #stones =str(stoneslist)
    #stones = "".join(stoneslist)
  #else:
   # stones = stones.replace('WR','RR',1)
  #count+=1
  #print(stones)

#print (stones)

red = 0
white = 0
for i in range(len(stones)):
  if stones[i] == "R":
    red +=1
for i in range(red):
  if stones[i] =='W':
    white+=1
print (white)
#print (count)