#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:20000000")
using namespace std;
int ri() {
  int x;
  scanf("%d", &x);
  return x;
}
long long rll() {
  long long x;
  scanf("%lld", &x);
  return x;
}
int smas[100500];
int mas[100500];
map<int, int> st;
void clear(int x) {
  if (st[x] == 0) st.erase(x);
}
void solve() {
  int n = ri();
  for (int i = (int)(1); i <= (int)(n); i++) mas[i] = ri(), smas[i] = mas[i];
  sort(smas + 1, smas + n + 1);
  int res = 0;
  for (int i = 1; i <= n;) {
    int r = i + 1;
    st.clear();
    st[mas[i]]++;
    st[smas[i]]--;
    clear(mas[i]);
    clear(smas[i]);
    while (!st.empty() && r <= n) {
      st[mas[r]]++;
      st[smas[r]]--;
      clear(mas[r]);
      clear(smas[r]);
      r++;
    }
    i = r;
    res++;
  }
  cout << res << endl;
}
int main() {
  solve();
  return 0;
}
