#include #include using namespace std; int main(){ int N; cin >> N; int A[N]; for(int i = 0; i < N; i++){ cin >> A[i]; } sort(A, A + N); int ans = 0; int num = 0; bool if_novelty = false; for(int i = 0; i < N; i++){ if(num == A[i]){ if_novelty = false; }else{ if(if_novelty){ ans++; } num = A[i]; if_novelty = true; } } if(num != A[N - 1] && if_novelty){ ans++; } cout << ans << endl; }