program main
 implicit none
 integer n,i,j,k,ans
 character*200000 C
 read(*,*) n
 read(*,*) c
 
 ans = 0
 k = n
 do i=1,n
   if(i >= k)then
     exit
   end if
   if(C(i:i)=='W')then
     do j=k,1,-1
       if(C(j:j)=='R')then
         C(i:i)=C(j:j)
         k=j-1
         ans = ans + 1
         exit
       end if
     end do
   end if
 end do
 
 write(*,*) ans
end program main