#include <bits/stdc++.h>
using namespace std;
inline bool ascending(int i, int j) { return (i < j); }
inline bool descending(int i, int j) { return (i > j); }
const int MN = 200000 + 10;
pair<long long, int> arr[MN];
int main() {
  int n;
  cin >> n;
  for (__typeof(0) i = 0; i != n; i++) {
    int temp;
    cin >> temp;
    arr[i] = make_pair(temp, i);
  }
  sort(arr, arr + n);
  int res = 0;
  int mx = -1;
  for (__typeof(0) i = 0; i != n; i++) {
    if (arr[i].second > mx) mx = arr[i].second;
    if (mx == i) ++res;
  }
  cout << res << endl;
  return 0;
}
