program d174

implicit none
character(len = 200000) :: c
integer :: i, n, r, a

r = 0
a = 0

read *, n
read *, c

do i = 1, n
 if(c(i:i) == 'R') then
  r = r + 1
 end if
end do

do i = r+1, n
 if(c(i:i) == 'R') then
  a = a + 1
 end if
end do

print *, a

end program d174