#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100 * 1000 + 10;
pair<int, int> a[MAX_N];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a, a + n);
  int ans = 0, maxi = 0;
  for (int i = 0; i < n; i++) {
    maxi = max(maxi, a[i].second);
    if (maxi == i) ans++;
  }
  cout << ans << endl;
  return 0;
}
