#include <iostream>
#include <vector>
#include <stdexcept>
#include <ostream>
#include <utility>
#include <type_traits>
#include <algorithm>

using namespace std;

//matrix,tensorの定義
template<typename T>
using matrix = vector<vector<T> >;

template<typename T>
using tensor = vector<matrix<T> >;

template<bool condition>
using enable_if_type = typename enable_if<condition,nullptr_t>::type;

//vectorに対する四則演算と<<のオーバーロード(前方宣言)
//+
template<typename T1, typename T2>
vector<decltype(declval<T1>() + declval<T2>())>
operator+(const vector<T1>& self,const vector<T2>& other);

//-
template<typename T1, typename T2>
vector<decltype(declval<T1>() - declval<T2>())>
operator-(const vector<T1>& self,const vector<T2>& other);

//vector * scholar
template<typename T1 ,typename T2, enable_if_type<is_arithmetic<T2>::value> = nullptr>
vector<decltype(declval<T1>() * declval<T2>())>
operator*(const vector<T1>& self,const T2& other);

//scholar * vector
template<typename T1, typename T2, enable_if_type<is_arithmetic<T1>::value> = nullptr>
vector<decltype(declval<T1>() * declval<T2>())>
operator*(const T1& self,const vector<T2>& other);


//vector * vector
template<typename T1, typename T2>
vector<decltype(declval<T1>() * declval<T2>())>
operator*(const vector<T1>& self,const vector<T2>& other);

// vector / vector
template<typename T1, typename T2>
vector<decltype(declval<T1>() / declval<T2>())>
operator/(const vector<T1>& self,const vector<T2>& other);

// vector / scholar
template<typename T1, typename T2, enable_if_type<is_arithmetic<T2>::value> = nullptr>
vector<decltype(declval<T1>() / declval<T2>())>
operator/(const vector<T1>& self,const T2& other);

// scholar / vector
template<typename T1, typename T2, enable_if_type<is_arithmetic<T1>::value> = nullptr>
vector<decltype(declval<T1>() / declval<T2>())>
operator/(const T1& self,const vector<T2>& other);

// << vector<scholar>
  template<typename T, enable_if_type<is_arithmetic<T>::value> = nullptr>
  ostream& operator<<(ostream& os, const vector<T>& self);

// << matrix,tensor
template<typename T, enable_if_type<not(is_arithmetic<T>::value)> = nullptr>
ostream& operator<<(ostream& os, const vector<T>& self);

//定義
//+
template<typename T1, typename T2>
vector<decltype(declval<T1>() + declval<T2>())>
operator+(const vector<T1>& self,const vector<T2>& other){
  if(self.size() != other.size())
    throw invalid_argument("You put different size vector.");  
  vector<decltype(declval<T1>() + declval<T2>())> result(self.size());
  auto resultItr = result.begin();
  auto selfItr = self.cbegin();
  auto otherItr = other.cbegin();
  while(resultItr != result.end() && selfItr != self.cend() &&
	otherItr != other.cend()){
    *resultItr = *selfItr + *otherItr;
    ++resultItr;
    ++selfItr;
    ++otherItr;
  }
  return result;
}

//-
template<typename T1, typename T2>
vector<decltype(declval<T1>() - declval<T2>())>
operator-(const vector<T1>& self,const vector<T2>& other){
  if(self.size() != other.size())
    throw invalid_argument("You put different size vector.");
  vector<decltype(declval<T1>() - declval<T2>())> result;
  result.resize(self.size());
  auto resultItr = result.begin();
  auto selfItr = self.cbegin();
  auto otherItr = other.cbegin();
  while(resultItr != result.end() && selfItr != self.cend() &&
	otherItr != other.cend()){
    *resultItr = *selfItr - *otherItr;
    ++resultItr;
    ++selfItr;
    ++otherItr;
  }  
  return result;
}


//vector * vector
template<typename T1, typename T2>
vector<decltype(declval<T1>() * declval<T2>())>
operator*(const vector<T1>& self,const vector<T2>& other){
  if(self.size() != other.size())
    throw invalid_argument("You put different size vector.");  
  vector<decltype(declval<T1>() * declval<T2>())> result;
  result.resize(self.size());
  auto resultItr = result.begin();
  auto selfItr = self.cbegin();
  auto otherItr = other.cbegin();
  while(resultItr != result.end() && selfItr != self.cend() &&
	otherItr != other.cend()){
    *resultItr = *selfItr * *otherItr;
    ++resultItr;
    ++selfItr;
    ++otherItr;
  }  
  return result;
}

//vector * scholar
template<typename T1 ,typename T2, enable_if_type<is_arithmetic<T2>::value> >
vector<decltype(declval<T1>() * declval<T2>())>
operator*(const vector<T1>& self,const T2& other){
  vector<decltype(declval<T1>() * declval<T2>())> result;
  result.resize(self.size());
  auto resultItr = result.begin();
  auto selfItr = self.cbegin();
  while(resultItr != result.end() && selfItr != self.cend()){
    *resultItr = *selfItr * other;
    ++resultItr;
    ++selfItr;
  }  
  return result;
}

//scholar * vector
template<typename T1, typename T2, enable_if_type<is_arithmetic<T1>::value> >
vector<decltype(declval<T1>() * declval<T2>())>
operator*(const T1& self,const vector<T2>& other){
  return other*self;
}

// vector / vector
template<typename T1, typename T2>
vector<decltype(declval<T1>() / declval<T2>())>
operator/(const vector<T1>& self,const vector<T2>& other){
  if(self.size() != other.size())
    throw invalid_argument("You put different size vector.");    
  vector<decltype(declval<T1>() / declval<T2>())> result;
  result.resize(self.size());
  auto resultItr = result.begin();
  auto selfItr = self.cbegin();
  auto otherItr = other.cbegin();
  while(resultItr != result.end() && selfItr != self.cend() &&
	otherItr != other.cend()){
    *resultItr = *selfItr / *otherItr;
    ++resultItr;
    ++selfItr;
    ++otherItr;
  }  
  return result;
}

// vector / scholar
template<typename T1, typename T2, enable_if_type<is_arithmetic<T2>::value> >
vector<decltype(declval<T1>() / declval<T2>())>
operator/(const vector<T1>& self,const T2& other){ 
  vector<decltype(declval<T1>() / declval<T2>())> result;
  result.resize(self.size());
  auto resultItr = result.begin();
  auto selfItr = self.cbegin();
  while(resultItr != result.end() && selfItr != self.cend()){
    *resultItr = *selfItr / other;
    ++resultItr;
    ++selfItr;
  }  
  return result;
}

// scholar / vector
template<typename T1, typename T2, enable_if_type<is_arithmetic<T1>::value> >
vector<decltype(declval<T1>() / declval<T2>())>
operator/(const T1& self,const vector<T2>& other){
  vector<decltype(declval<T1>() / declval<T2>())> result;
  result.resize(other.size());
  auto resultItr = result.begin();
  auto otherItr = other.cbegin();
  while(resultItr != result.end() && otherItr != other.cend()){
    *resultItr = self / *otherItr;
    ++resultItr;
    ++otherItr;
  }    
  return result;
}

// << vector<scholar>
  template<typename T, enable_if_type<is_arithmetic<T>::value> >
ostream& operator<<(ostream& os, const vector<T>& self){
  auto itr = self.begin();
  while(itr != self.end() - 1){
    os << *itr << ",";
    ++itr;
  }
  os << *itr << endl;
  return os;
}

// << matrix,tensor
template<typename T, enable_if_type<not(is_arithmetic<T>::value)> >
ostream& operator<<(ostream& os, const vector<T>& self){
  auto itr = self.begin();
  while(itr != self.end() - 1){
    os << *itr;
    ++itr;
  }
  os << *itr << endl;
  return os;
}


int main(){
  size_t n;
  cin >> n;
  vector<size_t> a(n);
  for(auto itr = a.begin(); itr != a.end(); ++itr)
    cin >> *itr;
  sort(a.begin(), a.end());
  size_t temp(0),count(0);
  for(auto itr = a.begin(); itr != a.end(); ++itr){
    if(temp != *itr){
      temp = *itr;
      ++count;
    }
  }
  if((n - count) % 2 != 0)
    --count;
  cout << count << endl;
  return 0;
}


Measured memory_bytes: 1024