#include using namespace std; using uint = unsigned int; using ll = long long; #define CIN( LL , A ) LL A; cin >> A #define GETLINE( A ) string A; getline( cin , A ) #define GETLINE_SEPARATE( A , SEPARATOR ) string A; getline( cin , A , SEPARATOR ) #define FOR_LL( VAR , INITIAL , FINAL_PLUS_ONE ) for( ll VAR = INITIAL ; VAR < FINAL_PLUS_ONE ; VAR ++ ) #define FOR_ITR( ARRAY , ITR , END ) for( auto ITR = ARRAY .begin() , END = ARRAY .end() ; ITR != END ; ITR ++ ) #define REPEAT( HOW_MANY_TIMES ) FOR_LL( VARIABLE_FOR_REPEAT , 0 , HOW_MANY_TIMES ) #define RETURN( ANSWER ) cout << ( ANSWER ) << endl; return 0 #define DOUBLE( PRECISION , ANSWER ) cout << fixed << setprecision( PRECISION ) << ( ANSWER ) << endl; return 0 #define MIN( A , B ) A < B ? A : B #define MAX( A , B ) A < B ? B : A template inline T Absolute( const T& a ){ return a > 0 ? a : - a; } constexpr const ll P = 1000000007; int main(){ CIN( ll , N ); ll N_plus = N + 1; ll A[100002]; A[0] = 0; FOR_LL( i , 1 , N_plus ){ cin >> A[i]; } A[N_plus] = 1000000001; sort( A + 1 , A + N_plus ); ll answer = 0; FOR_LL( i , 1 , N_plus ){ ll& Ai = A[i]; if( A[i - 1] != Ai && Ai != A[i + 1] ){ answer++; } } RETURN( answer ); }