program main
   implicit none
   integer:: n,num(2)=0,i
   integer,allocatable,dimension(:)::a,b,dum
   integer::ako(100000)=0,bko(100000)=0
   read(*,*)n
   allocate(dum(n),a(n/2),b(n/2))
   read(*,*)dum
   n=n/2
   do i=1,n
      a(i)=dum(i*2-1)
      b(i)=dum(i*2)
   enddo
   do i=1,n
      ako(a(i))=      ako(a(i))+1
      bko(b(i))=      bko(b(i))+1
   enddo
   num(1)=n-maxval(ako)
   num(2)=n-maxval(bko)
   write(*,*)sum(num)
end program main
