#include #include #include #include #include #include #include #include #include #include #include #include #define FOR(i, a, b) for(int i=(a);i<=(b);i++) #define RFOR(i, a, b) for(int i=(a);i>=(b);i--) #define MOD 1000000007 #define INF 1000000000 using namespace std; int main(void) { int n; int a[100001]; int count = 0; cin >> n; FOR(i, 0, n-1) { cin >> a[i]; } sort(a, a + n); FOR(i, 1, n - 1) { if (a[i] != a[i - 1]) { count++; } } cout << count << endl; return 0; }