#include <bits/stdc++.h>
using namespace std;
typedef long double ldb;
const int maxn = 1 << 21;
const int N = int(1e5);
const long long mod = int(1e9) + 7;
const long long inf = 1e18;
const double PI = 3.1415926536;
inline int Set(int n, int pos) { return n = n | 1 << pos; }
inline bool check(int n, int pos) { return n & 1 << pos; }
inline int Reset(int n, int pos) { return n = n & ~(1 << pos); }
inline int lastbit(int n) { return n & (-n); }
inline int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
inline int lcm(int a, int b) { return (a * b) / gcd(a, b); }
inline long long power(long long a, long long b) {
  long long ans = 1;
  a = a % mod;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    b >>= 1;
    a = (a * a) % mod;
  }
  return ans;
}
inline long long invmod(long long a) {
  long long ans = power(a, mod - 2);
  return ans;
}
inline long long Egcd(long long a, long long b, long long *x, long long *y) {
  if (a == 0) {
    *x = 0, *y = 1;
    return b;
  }
  long long x1, y1;
  long long gcd = Egcd(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd;
}
inline int bs(int arr[], int l, int r, int item) {
  if (l == r) {
    if (arr[l] == item)
      return r;
    else
      return -1;
  }
  if (item <= arr[(l + r) / 2])
    return bs(arr, l, (l + r) / 2, item);
  else
    return bs(arr, (l + r) / 2 + 1, r, item);
}
inline void fastin(int &x) {
  x = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  return;
}
long long T[N + 1];
long long ans, sum;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> T[i];
  sort(T, T + n);
  for (int i = 0; i < n; i++) {
    if (sum > T[i])
      continue;
    else
      sum += T[i], ans++;
  }
  cout << ans;
  return 0;
}

### Prompt

Your challenge is to write a CPP solution to the following problem:

Little girl Susie went shopping with her mom and she wondered how to improve service quality. 

There are n people in the queue. For each person we know time ti needed to serve him. A person will be disappointed if the time he waits is more than the time needed to serve him. The time a person waits is the total time when all the people who stand in the queue in front of him are served. Susie thought that if we swap some people in the queue, then we can decrease the number of people who are disappointed. 

Help Susie find out what is the maximum number of not disappointed people can be achieved by swapping people in the queue.

Input

The first line contains integer n (1 ≤ n ≤ 105).

The next line contains n integers ti (1 ≤ ti ≤ 109), separated by spaces.

Output

Print a single number — the maximum number of not disappointed people in the queue.

Examples

Input

5
15 2 1 5 3


Output

4

Note

Value 4 is achieved at such an arrangement, for example: 1, 2, 3, 5, 15. Thus, you can make everything feel not disappointed except for the person with time 5.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
typedef long double ldb;
const int maxn = 1 << 21;
const int N = int(1e5);
const long long mod = int(1e9) + 7;
const long long inf = 1e18;
const double PI = 3.1415926536;
inline int Set(int n, int pos) { return n = n | 1 << pos; }
inline bool check(int n, int pos) { return n & 1 << pos; }
inline int Reset(int n, int pos) { return n = n & ~(1 << pos); }
inline int lastbit(int n) { return n & (-n); }
inline int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
inline int lcm(int a, int b) { return (a * b) / gcd(a, b); }
inline long long power(long long a, long long b) {
  long long ans = 1;
  a = a % mod;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    b >>= 1;
    a = (a * a) % mod;
  }
  return ans;
}
inline long long invmod(long long a) {
  long long ans = power(a, mod - 2);
  return ans;
}
inline long long Egcd(long long a, long long b, long long *x, long long *y) {
  if (a == 0) {
    *x = 0, *y = 1;
    return b;
  }
  long long x1, y1;
  long long gcd = Egcd(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd;
}
inline int bs(int arr[], int l, int r, int item) {
  if (l == r) {
    if (arr[l] == item)
      return r;
    else
      return -1;
  }
  if (item <= arr[(l + r) / 2])
    return bs(arr, l, (l + r) / 2, item);
  else
    return bs(arr, (l + r) / 2 + 1, r, item);
}
inline void fastin(int &x) {
  x = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  return;
}
long long T[N + 1];
long long ans, sum;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> T[i];
  sort(T, T + n);
  for (int i = 0; i < n; i++) {
    if (sum > T[i])
      continue;
    else
      sum += T[i], ans++;
  }
  cout << ans;
  return 0;
}

```