#include <bits/stdc++.h>
using namespace std;
const long long INF = 10000;
const long long MAXN = 1000;
int n, a[MAXN], sum, cnt, ans;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a, a + n + 1);
  for (int i = n; i >= 1; i--) {
    cnt += a[i];
    ans++;
    if (cnt > sum - cnt) {
      cout << ans;
      return 0;
    }
  }
  return 0;
}
