n=int(input())
li=[]
red=0
white=0
count=0
li=list(input())
for i in li:
  if i == 'R':
    red+=1
  else:
    white+=1

checkw=0
for i in range(red):
  if li[i]=='W':
    checkw+=1

checkr=0
for i in range(white):
  if li[i+red]=='R':
    checkr+=1
sa=checkw-checkr
if sa==0:
  print(checkr)
elif sa>0:
  print(checkr+sa)
else:
  print(checkw+sa) n=int(input()) n int(input()) int input() input li=[] li [] red=0 red 0 white=0 white 0 count=0 count 0 li=list(input()) li list(input()) list input() input for i in li:
  if i == 'R':
    red+=1
  else:
    white+=1 i li if i == 'R':
    red+=1
  else:
    white+=1 i == 'R' i 'R' red+=1 red 1 white+=1 white 1 checkw=0 checkw 0 for i in range(red):
  if li[i]=='W':
    checkw+=1 i range(red) range red if li[i]=='W':
    checkw+=1 li[i]=='W' li[i] li i 'W' checkw+=1 checkw 1 checkr=0 checkr 0 for i in range(white):
  if li[i+red]=='R':
    checkr+=1 i range(white) range white if li[i+red]=='R':
    checkr+=1 li[i+red]=='R' li[i+red] li i+red i red 'R' checkr+=1 checkr 1 sa=checkw-checkr sa checkw-checkr checkw checkr if sa==0:
  print(checkr)
elif sa>0:
  print(checkr+sa)
else:
  print(checkw+sa) sa==0 sa 0 print(checkr) print checkr elif sa>0:
  print(checkr+sa) sa>0 sa 0 print(checkr+sa) print checkr+sa checkr sa print(checkw+sa) print checkw+sa checkw sa red=0 0 red white+=1 1 white li=list(input()) list(input()) li n=int(input()) int(input()) n white=0 0 white checkr+=1 1 checkr checkw+=1 1 checkw checkw=0 0 checkw checkr=0 0 checkr red+=1 1 red sa=checkw-checkr checkw-checkr sa count=0 0 count li=[] [] li
n=int(input())
li=[]
red=0
white=0
count=0
li=list(input())
for i in li:
  if i == 'R':
    red+=1
  else:
    white+=1

checkw=0
for i in range(red):
  if li[i]=='W':
    checkw+=1

checkr=0
for i in range(white):
  if li[i+red]=='R':
    checkr+=1
sa=checkw-checkr
if sa==0:
  print(checkr)
elif sa>0:
  print(checkr+sa)
else:
  print(checkw+sa)