import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int []A = new int[N]; for(int i = 0; i < N; i++) { A[i] = scan.nextInt(); } scan.close(); Arrays.sort(A); int cnt = 0; for(int i = 0; i < N - 2; i++) { int a1 = A[i]; int a2 = A[i + 1]; int a3 = A[i + 2]; if(a1 != a2 && a2 != a3) { cnt ++; } } if(A[0] != A[1]) { cnt ++; } if(A[N - 2] != A[N - 1]) { cnt ++; } System.out.println(cnt); } }