#include <bits/stdc++.h>
using namespace std;
const int maxsize = 1e5 + 10;
int a[maxsize];
int dp[maxsize];
int main() {
  int n;
  while (cin >> n) {
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
    }
    int mi = 1e9 + 10;
    for (int i = n; i >= 1; i--) {
      mi = min(mi, a[i]);
      dp[i] = mi;
    }
    int ans = 0;
    int maxx = a[1];
    for (int i = 1; i <= n; i++) {
      maxx = max(maxx, a[i]);
      if (i == n) {
        ans++;
        continue;
      }
      int minx = dp[i + 1];
      if (maxx <= minx) ans++;
    }
    cout << ans << endl;
  }
  return 0;
}
