#include <bits/stdc++.h>
using namespace std;
struct tw {
  int x, y;
};
tw a[111111], b[111111];
bool comp(tw e, tw p) { return (e.x < p.x || (e.x == p.x && e.y < p.y)); }
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i].x;
    a[i].y = i;
  }
  sort(a + 1, a + n + 1, comp);
  for (int i = 1; i <= n; ++i) {
    b[i].x = i;
    b[i].y = a[i].y;
    if (b[i].x > b[i].y) swap(b[i].x, b[i].y);
  }
  sort(b + 1, b + n + 1, comp);
  int ans = 1, w = b[1].y;
  for (int i = 2; i <= n; ++i) {
    if (b[i].x > w) ++ans;
    if (w < b[i].y) w = b[i].y;
  }
  cout << ans;
  return 0;
}
