#include <bits/stdc++.h>
using namespace std;
int a[100005], mini[100005];
int main() {
  int n;
  while (cin >> n) {
    for (int i = 0; i < n; i++) scanf("%d", &a[i]);
    mini[n] = (1 << 30);
    for (int i = n - 1; i >= 0; i--) mini[i] = min(mini[i + 1], a[i]);
    int ans = 0, maxi = -1;
    for (int i = 0; i < n; i++) {
      maxi = max(maxi, a[i]);
      if (mini[i + 1] >= maxi) {
        ans++;
        maxi = -1;
      }
    }
    cout << ans << endl;
  }
}
