#include <bits/stdc++.h>
using namespace std;
int min(int a, int b) { return (a < b ? a : b); }
int max(int a, int b) { return (a > b ? a : b); }
int main() {
  int n;
  cin >> n;
  int H[n], Max[n], Min[n + 1];
  cin >> H[0];
  Max[0] = H[0];
  for (int k = 1; k < n; k++) {
    cin >> H[k];
    Max[k] = max(Max[k - 1], H[k]);
  }
  Min[n] = 1e9 + 1;
  for (int k = n - 1; k >= 0; k--) Min[k] = min(Min[k + 1], H[k]);
  int blocks = 0;
  for (int k = 0; k < n; k++) {
    if (Max[k] <= Min[k + 1]) blocks++;
  }
  cout << blocks << endl;
  return 0;
}
