import java.util.HashSet; import java.util.Scanner; public class nn { public static int ans(int[] A){ int cnt = 0; boolean flag = false; HashSet cheack = new HashSet(); for(int now : A){ if (!cheack.contains(now)) { cheack.add(now); cnt++; flag = true; } else { if (flag) { cnt--; flag = false; } } } if(cnt > 0) return cnt; else return 0; } public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int a[] = new int[N]; for (int i = 0; i < N; i++) { a[i] = sc.nextInt(); } System.out.println(ans(a)); } }