program sample
    implicit none
  
    integer(8) :: i,j,m,n,b(100000)
    
    integer(8),allocatable :: a(:),y(:)
  
    read(*,*) n
    do i=1,100000
        b(i)=0
    end do
    allocate(a(n))
    read(*,*)a
    do i=1,n
        m=a(i)
        b(m)=b(m)+1
    end do
    m=0
    do i=1,100000
        if (b(i)>0)then
            m=m+1
        end if
    end do
    if (mod(m,2)==0)then
        m=m-1
    end if
    write(*,*) m
    deallocate(a)
    stop
end program sample
  

