#include <bits/stdc++.h>
const double PI = 2 * asin(1);
using namespace std;
int h[100005], mini[100005];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> h[i];
  int m = 1000000005;
  for (int i = n; i >= 1; i--) {
    if (h[i] < m) m = h[i];
    mini[i] = m;
  }
  int cnt = 0, j = 1, maxi = 0;
  mini[n + 1] = 1000000005;
  while (j <= n) {
    if (maxi < h[j]) maxi = h[j];
    if (maxi <= mini[j + 1]) {
      cnt++;
      maxi = 0;
    }
    j++;
  }
  cout << cnt;
}
