#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
const long long LIM = 1e18;
const int INF = 0x3f3f3f3f;
const double eps = 1e-4;
const double PI = atan(1.0) * 4;
const int mod = 1e9 + 7;
int n, h[N + 10], g[N + 10];
priority_queue<int, vector<int>, greater<int> > que;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> h[i];
  memcpy(g, h, sizeof(h));
  sort(g + 1, g + 1 + n);
  int p = 1, ans = 0;
  for (int i = 1; i <= n; i++) {
    que.push(h[i]);
    while (!que.empty() && que.top() == g[p]) {
      p++;
      que.pop();
    }
    if (que.empty()) ans++;
  }
  cout << ans;
  return 0;
}
