#include #include int asc(const void *a, const void *b) { return *(int*)a - *(int*)b; } int main(void) { int N; int A[100000]; int i, j; int count, s; scanf("%d", &N); for (i = 0; i < N; i++) { scanf("%d", &A[i]); } qsort(A, N, sizeof(int), asc); count = 0; for (i = 0; i < N; i++) { if ((i == 0) && (A[i] != A[i+1])) { count++; } else if ((i == (N-1)) && (A[i-1] != A[i])) { count++; } else if ((A[i-1] != A[i]) && (A[i] != A[i+1])) { count++; } else { } } printf("%d\n", count); return 0; }