#include #include int N; int main(){ //input scanf("%d",&N); long A[N]; for (int i = 0;i < N;i++){ scanf("%ld",&A[i]); } //sort array A std::sort(A,A+N); //search int count = 0; for (long i = 0;i < N;i++){ if (i == 0){ if (A[i] != A[i+1]){ count++; } }else if (i == N-1){ if (A[i-1] != A[i]){ count++; } }else{ if (A[i-1] != A[i] && A[i] != A[i+1]){ count++; } } } //output printf("%d\n",count); return 0; }