Language: C++

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;



class Program
{
    const int MOD = 1000000007;
    const int INF = 1 << 30;



    static void Main(string[] args)
    {
        Solve();
    }



    static void Solve()
    {
        Scaner sc = new Scaner();
        write wr = new write();
        Math2 mmath = new Math2();
        //ここから

        int N=sc.Int1;
        var A=sc.IntArr;
        var AA=A.Distinct();
        
        int uni=AA.ToArray().Length;

        wr.wri(uni%2==0 ? uni:uni-1);




    }


    
}

class PriorityQueue<T>
{
    private readonly List<T> heap;
    private readonly Comparison<T> compare;
    private int size;
    public PriorityQueue() : this(Comparer<T>.Default) {} 
    public PriorityQueue(IComparer<T> comparer) : this(16, comparer.Compare) { }
    public PriorityQueue(Comparison<T> comparison) : this(16, comparison) { }
    public PriorityQueue(int capacity, Comparison<T> comparison)
    {
        this.heap = new List<T>(capacity);
        this.compare = comparison;
    }
    public void Enqueue(T item)
    {
        this.heap.Add(item);
        var i = size++;
        while (i > 0)
        {
            var p = (i - 1) >> 1;
            if (compare(this.heap[p], item) <= 0)
                break;
            this.heap[i] = heap[p];
            i = p;
        }
        this.heap[i] = item;

    }
    public T Dequeue()
    {
        var ret = this.heap[0];
        var x = this.heap[--size];
        var i = 0;
        while ((i << 1) + 1 < size)
        {
            var a = (i << 1) + 1;
            var b = (i << 1) + 2;
            if (b < size && compare(heap[b], heap[a]) < 0) a = b;
            if (compare(heap[a], x) >= 0)
                break;
            heap[i] = heap[a];
            i = a;
        }
        heap[i] = x;
        heap.RemoveAt(size);
        return ret;
    }
    public T Peek() { return heap[0]; }
    public int Count { get { return size; } }
    public bool Any() { return size > 0; }
}


 class Math2
{
    public long[] Fact;  //Nまでの階乗
    public long[] invFact;  //階乗の逆元
    public void FactoricalModSet(long N,long MOD=1000000007)
    {
        Fact = new long[N + 1];
        invFact = new long[N + 1];

        Fact[0] = 1;
        for(long i = 1; i <= N; ++i)
        {
            Fact[i] = Fact[i - 1] * i%MOD;
        }
        invFact[N] = powMOD(Fact[N], MOD - 2);

        for (long i = N; i > 0; --i)
        {
            invFact[i - 1] = invFact[i] * i%MOD;
        }

    }

    public long nCrMod(long n,long r,long MOD=1000000007)
    {
        return (Fact[n] * invFact[r] % MOD * invFact[n-r]%MOD);
    }

    public long powMOD(long x,long n,long MOD = 1000000007)
    {
        long res = 1;
        while (n > 0)
        {
            if ((n & 1) != 0) res = res * x % MOD;
            x = x * x % MOD;
            n >>= 1;
        }
        return res;
    }

    static long GCD(long x, long y)
    {
        if (y == 0) return x;
        return GCD(y, x % y);
    }

    static long LCM(long x, long y)
    {
        return x * y / GCD(x, y);
    }
}


class Scaner
{
    public string Str => Console.ReadLine();

    public string[] StrArr => Str.Split(' ');

    public long[] LongArr => StrArr.Select(long.Parse).ToArray();
    public int[] IntArr => StrArr.Select(int.Parse).ToArray();
    public char[] CharArr => Str.ToArray();
    public long Long1 => LongArr[0];
    public int Int1 => IntArr[0];
    
}



class write
{
    public  void wri<T>(T x)
    {
        Console.WriteLine(x);
    }
}



Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Threading.Tasks;
      |       ^~~~~~
a.cc:16:22: error: 'string' has not been declared
   16 |     static void Main(string[] args)
      |                      ^~~~~~
a.cc:16:31: error: expected ',' or '...' before 'args'
   16 |     static void Main(string[] args)
      |                               ^~~~
a.cc:45:2: error: expected ';' after class definition
   45 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Solve()':
a.cc:25:9: error: 'Scaner' was not declared in this scope
   25 |         Scaner sc = new Scaner();
      |         ^~~~~~
a.cc:26:9: error: 'write' was not declared in this scope
   26 |         write wr = new write();
      |         ^~~~~
a.cc:27:9: error: 'Math2' was not declared in this scope
   27 |         Math2 mmath = new Math2();
      |         ^~~~~
a.cc:30:15: error: 'sc' was not declared in this scope
   30 |         int N=sc.Int1;
      |               ^~
a.cc:31:9: error: 'var' was not declared in this scope
   31 |         var A=sc.IntArr;
      |         ^~~
a.cc:32:13: error: expected ';' before 'AA'
   32 |         var AA=A.Distinct();
      |             ^~
a.cc:34:17: error: 'AA' was not declared in this scope
   34 |         int uni=AA.ToArray().Length;
      |                 ^~
a.cc:36:9: error: 'wr' was not declared in this scope
   36 |         wr.wri(uni%2==0 ? uni:uni-1);
      |         ^~
a.cc: At global scope:
a.cc:47:7: error: 'PriorityQueue' is not a class template
   47 | class PriorityQueue<T>
      |       ^~~~~~~~~~~~~
a.cc:47:21: error: 'T' was not declared in this scope
   47 | class PriorityQueue<T>
      |                     ^
a.cc:49:12: error: expected ':' before 'readonly'
   49 |     private readonly List<T> heap;
      |            ^~~~~~~~~
      |            :
a.cc:49:13: error: 'readonly' does not name a type
   49 |     private readonly List<T> heap;
      |             ^~~~~~~~
a.cc:50:12: error: expected ':' before 'readonly'
   50 |     private readonly Comparison<T> compare;
      |            ^~~~~~~~~
      |            :
a.cc:50:13: error: 'readonly' does not name a type
   50 |     private readonly Comparison<T> compare;
      |             ^~~~~~~~
a.cc:51:12: error: expected ':' before 'int'
   51 |     private int size;
      |            ^~~~
      |            :
a.cc:52:11: error: expected ':' before 'PriorityQueue'
   52 |     public PriorityQueue() : this(Comparer<T>.Default) {}
      |           ^~~~~~~~~~~~~~
      |           :
a.cc:53:11: error: expected ':' before 'PriorityQueue'
   53 |     public PriorityQueue(IComparer<T> comparer) : this(16, comparer.Compare) { }
      |           ^~~~~~~~~~~~~~
      |           :
a.cc:53:35: error: expected ')' before '<' token
   53 |     public PriorityQueue(IComparer<T> comparer) : this(16, comparer.Compare) { }
      |                         ~         ^
      |                                   )
a.cc:54:11: error: expected ':' before 'PriorityQueue'
   54 |     public PriorityQueue(Comparison<T> comparison) : this(16, comparison) { }
      |           ^~~~~~~~~~~~~~
      |           :
a.cc:54:36: error: expected ')' before '<' token
   54 |     public PriorityQueue(Comparison<T> comparison) : this(16, comparison) { }
      |                         ~          ^
      |                                    )
a.cc:55:11: error: expected ':' before 'PriorityQueue'
   55 |     public PriorityQueue(int capacity, Comparison<T> comparison)
      |           ^~~~~~~~~~~~~~
      |           :
a.cc:55:40: error: 'Comparison' has not been declared
   55 |     public PriorityQueue(int capacity, Comparison<T> comparison)
      |                                        ^~~~~~~~~~
a.cc:55:50: error: expected ',' or '...' before '<' token
   55 |     public PriorityQueue(int capacity, Comparison<T> comparison)
      |                                                  ^
a.cc:60:11: error: expected ':' before 'void'
   60 |     public void Enqueue(T item)
      |           ^~~~~
      |           :
a.cc:60:25: error: 'T' has not been declared
   60 |     public void Enqueue(T item)
      |                         ^
a.cc:75:11: error: expected ':' before 'T'
   75 |     public T Dequeue()
      |           ^~
      |           :
a.cc:75:12: error: 'T' does not name a type
   75 |     public T Dequeue()
      |            ^
a.cc:94:11: error: expected ':' before 'T'
   94 |     public T Peek() { return heap[0]; }
      |           ^~
      |           :
a.cc:94:12: error: 'T' does not name a type
   94 |     public T Peek() { return heap[0]; }
      |            ^
a.cc:95:11: error: expected ':' before 'int'
   95 |     public int Count { get { return size; } }
      |           ^~~~
      |           :
a.cc:95:45: error: expected ';' at end of member declaration
   95 |     public int Count { get { return size; } }
      |                                             ^
      |                                              ;
a.cc:96:11: error: expected ':' before 'bool'
   96 |     public bool Any() { return size > 0; }
      |           ^~~~~
      |           :
a.cc:97:2: error: expected ';' after class definition
   97 | }
      |  ^
      |  ;
a.cc:95:24: error: 'get' was not declared in this scope
   95 |     public int Count { get { return size; } }
      |                        ^~~
a.cc:95:28: error: expected '}' before '{' token
   95 |     public int Count { get { return size; } }
      |                            ^
a.cc:95:22: note: to match this '{'
   95 |     public int Count { get { return size; } }
      |                      ^
a.cc:95:28: error: cannot convert '<brace-enclosed initializer list>' to 'int' in initialization
   95 |     public int Count { get { return size; } }
      |                            ^
a.cc:95:28: error: expected ';' before '{' token
a.cc: In constructor 'PriorityQueue::PriorityQueue()':
a.cc:52:30: error: expected identifier before 'this'
   52 |     public PriorityQueue() : this(Comparer<T>.Default) {}
      |                              ^~~~
a.cc:52:30: error: expected '{' before 'this'
a.cc: In constructor 'PriorityQueue::PriorityQueue(int, int)':
a.cc:57:14: error: request for member 'heap' in '(PriorityQueue*)this', which is of pointer type 'PriorityQueue*' (maybe you meant to use '->' ?)
   57 |         this.heap = new List<T>(capacity);
      |              ^~~~
a.cc:57:25: error: 'List' does not name a type
   57 |         this.heap = new List<T>(capacity);
      |                         ^~~~
a.cc:57:30: error: 'T' was not declared in this scope
   57 |         this.heap = new List<T>(capacity);
      |                              ^
a.cc:58:14: error: request for member 'compare' in '(PriorityQueue*)this', which is of pointer type 'PriorityQueue*' (maybe you meant to use '->' ?)
   58 |         this.compare = comparison;
      |              ^~~~~~~
a.cc:58:24: error: 'comparison' was not declared in this scope
   58 |         this.compare = comparison;
      |                        ^~~~~~~~~~
a.cc: In member function 'void PriorityQueue::Enqueue(int)':
a.cc:62:14: error: request for member 'heap' in '(PriorityQueue*)this', which is of pointer type 'PriorityQueue*' (maybe you meant to use '->' ?)
   62 |         this.heap.Add(item);
      |              ^~~~
a.cc:63:9: error: 'var' was not declared in this scope
   63 |         var i = size++;
      |         ^~~
a.cc:64:16: error: 'i' was not declared in this scope
   64 |         while (i > 0)
      |                ^
a.cc:66:17: error: expected ';' before 'p'
   66 |             var p = (i - 1) >> 1;
      |                 ^
a.cc:67:30: error: request for member 'heap' in '(PriorityQueue*)this', which is of pointer type 'PriorityQueue*' (maybe you meant to use '->' ?)
   67 |             if (compare(this.heap[p], item) <= 0)
      |                              ^~~~
a.cc:67:35: error: 'p' was not declared in this scope
   67 |             if (compare(this.heap[p], item) <= 0)
      |                                   ^
a.cc:67:17: error: 'compare' was not declared in this scope
   67 |             if (compare(this.heap[p], item) <= 0)
      |                 ^~~~~~~
a.cc:69:18: error: request for member 'heap' in '(PriorityQueue*)this', which is of pointer type 'PriorityQueue*' (maybe you meant to use '->' ?)
   69 |             this.heap[i] = heap[p];
      |                  ^~~~
a.cc:69:28: error: 'heap' was not declared in this scope
   69 |             this.heap[i] = heap[p];
      |                            ^~~~
a.cc:69:33: error: 'p' was not declared in this scope
   69 |             this.heap[i] = heap[p];
      |                                 ^
a.cc:72:14: error: request for member 'heap' in '(PriorityQueue*)this', which is of pointer type 'PriorityQueue*' (maybe you meant to use '->' ?)
   72 |         this.heap[i] = item;
      |              ^~~~
a.cc:72:19: error: 'i' was not declared in this scope
   72 |         this.heap[i] = item;
      |                   ^
a.cc: At global scope:
a.cc:102:11: error: expected ':' before 'long'
  102 |     public long[] Fact;  //Nまでの階乗
      |           ^~~~~
      |           :
a.cc:102:16: error: expected unqualified-id before '[' token
  102 |     public long[] Fact;  //Nまでの階乗
      |                ^
a.cc:103:11: error: expected ':' before 'long'
  103 |     public long[] invFact;  //階乗の逆元
      |           ^~~~~
      |           :
a.cc:103:16: error: expected unqualified-id before '[' token
  103 |     public long[] invFact;  //階乗の逆元
      |                ^
a.cc:104:11: error: expected ':' before 'void'
  104 |     public void FactoricalModSet(long N,long MOD=