#include <bits/stdc++.h>
using namespace std;
int n, ar[100010], ans = 0;
pair<int, int> p[100010];
int main() {
  int maxn = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
    p[i].first = ar[i];
    p[i].second = i;
  }
  sort(p, p + n);
  for (int i = 0; i < n; i++) {
    if (p[i].second > maxn) maxn = p[i].second;
    if (i == maxn) ans++;
  }
  cout << ans;
}
