#include #include #include #include #include #include #include #include #define rep(i, n) for (int i = 0; i < n; ++i) #define FOR(i, a, b) for (int i = a; i < b; ++i) #define ll long long #define pb(x) push_back(x) using namespace std; int main() { unordered_map mp; int n; cin >> n; if (n == 1) { cout << 1 << endl; return 0; } int a[100000]; rep(i, n) cin >> a[i]; if (n == 2) { cout << (a[0] == a[1] ? 0 : 2) << endl; return 0; } sort(a, a + n); int cnt = 0; if (a[0] != a[1]) cnt++; FOR(i, 1, n - 1) if (a[i - 1] != a[i] && a[i] != a[i + 1]) cnt++; if(a[n - 1] != a[n - 2]) cnt++; cout << cnt << endl; return 0; }