#include <bits/stdc++.h>   using namespace std;   int n, sol;   multiset<int> S;   multiset<int>::iterator p;   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       int val;       scanf( %d , &val);       S.insert(val);     }     long long s = 0;     for (int i = 1; i <= n; i++) {       p = S.lower_bound(s);       if (p == S.end()) break;       if (*p < s) p++;       sol++;       s += *p;       S.erase(p);     }     printf( %d n , sol);     return 0;   }   