#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, x = INT_MAX, c;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (x > a) {
      x = a;
      c = i;
    }
    v.push_back(a);
  }
  int cnt = 0;
  for (int i = c; i < n; i++) {
    if (v[i] >= x) {
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
