#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7, maxn = 100005, ln = 18;
const int inf = int(1e9), shift = 30, etf = mod - 1;
int a[maxn];
vector<pair<int, int> > vec;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    vec.push_back(pair<int, int>(a[i], 1));
  }
  sort(vec.begin(), vec.end());
  int mx, cnt, ans = 0, l = 0;
  for (int i = 0; i < n; i++) {
    if (l == i) {
      mx = a[i];
      cnt = 1;
      if (mx == vec[i].first && cnt == vec[i].second) {
        ans++;
        l = i + 1;
      }
      continue;
    }
    if (mx < a[i]) {
      mx = a[i];
      cnt = 1;
    } else if (mx == a[i]) {
      cnt++;
    }
    if (vec[i].first == vec[i - 1].first) vec[i].second += vec[i - 1].second;
    if (mx == vec[i].first && cnt == vec[i].second) {
      ans++;
      l = i + 1;
    }
  }
  cout << ans << endl;
  return 0;
}
