#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, mx = 0, ct = 0, sum1 = 0, sum2 = 0;
  cin >> n;
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    sum1 += a[i];
    sum2 += b[i];
    if (sum1 == sum2) {
      ct++;
    }
  }
  cout << ct;
}
