#include <bits/stdc++.h>
using namespace std;
multiset<long int> st;
multiset<long int>::iterator it;
map<long int, int> m;
int main() {
  std::ios::sync_with_stdio(false);
  int n, i;
  long a;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a;
    st.insert(a);
    m[a]++;
  }
  int ans = 0;
  long t = 0;
  i = 0;
  bool flag = 0;
  while (ans <= n) {
    it = st.find(t);
    if (it != st.end())
      t = t + *it;
    else {
      it = upper_bound(st.begin(), st.end(), t);
      if (it == st.end()) break;
      t = t + *it;
    }
    ans++;
    m[*it]--;
    if (m[*it] == 0) st.erase(it);
  }
  cout << ans;
  return 0;
}
