#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  const int num = N;
  int H[num];
  for (int i = 0; i < num; i++) {
    cin >> H[i];
  }
  int k = H[0];
  for (int s = 0; s < num - 1; s++) {
    for (int t = s + 1; t < num; t++) {
      if (H[t] > H[s]) {
        int tmp = H[t];
        H[t] = H[s];
        H[s] = tmp;
      }
    }
  }
  for (int res = 0; H[res] >= k; res++) {
    cout << res << endl;
  }
  return 0;
}
