#include #include #include using namespace std; int main() { int n; cin >> n; vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } int k = 0; sort(a.begin(), a.end()); if (n>2) { for (int i = 1; i < n - 1; i++) { if (a[i - 1] != a[i] && a[i] != a[i + 1]) { k++; } } if (a[0] != a[1])k++; if (a[n - 2] != a[n - 1])k++; } else if (n == 2) { if (a[0] != a[1])k+=2; } else { k++; } cout << k << endl; }