#include <bits/stdc++.h>
using namespace std;
void read(vector<long long> &v) {
  for (int i = 0; i < v.size(); i++) cin >> v[i];
}
void print(vector<long long> v) {
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
}
long long n, m, a, b, temp;
string str;
set<long long> s;
vector<long long> v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  v.resize(n);
  read(v);
  vector<long long> v2 = v;
  sort(v2.begin(), v2.end());
  map<long long, queue<long long>> mp;
  for (int i = 0; i < n; i++) {
    mp[v2[i]].push(i);
  }
  priority_queue<long long> pq;
  long long lastindex;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    pq.push(mp[v[i]].front());
    mp[v[i]].pop();
    if (pq.top() == i) ans++;
  }
  cout << ans;
}
