import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()) {
int n = sc.nextInt();
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = sc.nextInt();
}
//判断种类数
Arrays.sort(arr);
int cnt = 1;
int x = arr[0];
for (int i = 0; i < n; i++) {
if(x != arr[i]) {
cnt++;
x = arr[i];
}
}
if(cnt % 2 == 0) System.out.println(cnt-1);
else System.out.println(cnt);
}
}
}