#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, a[N], sum, ans;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    if (sum <= a[i]) sum += a[i], ans++;
  }
  printf("%d\n", ans);
  return 0;
}
