#include <bits/stdc++.h>
using namespace std;
long long size, seg1[2 * 200005], seg2[2 * 200005], a[200005], b[200005],
    seg3[2 * 200005], seg4[2 * 200005];
long long temp = 0;
long long f(long long u, long long v) { return min(u, v); }
long long query(long long l, long long r, long long u, long long v,
                long long seg[]) {
  long long mid = (u + v) / 2;
  if ((l == u) && (r == v))
    return seg[(size + u) / (r - l + 1) - 1];
  else if (l > mid)
    return query(l, r, mid + 1, v, seg);
  else if (r <= mid)
    return query(l, r, u, mid, seg);
  else
    return f(query(l, mid, u, mid, seg), query(mid + 1, r, mid + 1, v, seg));
}
void update(long long ind, long long num, long long seg[]) {
  long long pos = size + ind - 1;
  seg[pos] = num;
  while (pos) {
    seg[(pos - 1) / 2] = f(seg[pos], seg[pos + pos % 2 * 2 - 1]);
    pos--;
    pos /= 2;
  }
}
int main() {
  ios::sync_with_stdio(false);
  long long i, t, j, k, l, m, n;
  cin >> n;
  long long INF = 1;
  for (size = 1; size < n; size *= 2)
    ;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    update(i, a[i], seg1);
  }
  long long maxi = -INF, cnt = 0;
  for (i = 0; i < n - 1; i++) {
    maxi = max(a[i], maxi);
    if (maxi <= query(i + 1, n - 1, 0, size - 1, seg1)) {
      cnt++;
      maxi = -INF;
    }
  }
  cout << cnt + 1 << endl;
}
