#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000000000")
using namespace std;
int n, h[100011];
map<int, int> mp;
vector<int> vec;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> h[i], vec.push_back(h[i]);
  sort((vec).begin(), (vec).end());
  int neg = 0, pos = 0, ans = 0;
  for (int i = vec.size() - 1; i >= 0; i--) {
    int tmp = ++mp[vec[i]];
    if (tmp == 1)
      pos++;
    else if (tmp == 0)
      neg--;
    tmp = --mp[h[i]];
    if (tmp == -1) neg++;
    if (tmp == 0) pos--;
    if (neg == 0 && pos == 0) ans++;
  }
  cout << ans << endl;
  return 0;
}
