//inlclude前用define #define _USE_MATH_DEFINES //include #include #include #include #include #include using namespace std; //typedef typedef vector VI; typedef vector VS; typedef vector VC; int main() { int n; cin >> n; VI a(n); for (int i = 0; i < n; i++) cin >> a[i]; sort(a.begin(), a.end()); int memo = a[0],cnt=0; bool sinki = true; for (int i = 1; i < n; i++) { if (memo == a[i]) { sinki = false; } else { memo = a[i]; if (sinki) { cnt++; } sinki = true; } } cout << cnt << endl; return 0; }