#include <bits/stdc++.h>
using namespace std;
const int INF = 1e18 + 7;
const int N = 3e5 + 7;
const int MOD = 1e9 + 7;
const double Pi = 3.14159265358979323846;
int a[N], b[N];
signed main() {
  {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout << fixed << setprecision(20);
    cerr << fixed << setprecision(11);
  };
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + n);
  int ans = 0, k = 0;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    k -= (mp[b[i]] > 0) + (mp[a[i]] > 0);
    mp[b[i]]++;
    mp[a[i]]--;
    k += (mp[b[i]] > 0) + (mp[a[i]] > 0);
    if (k == 0) ans++;
  }
  cout << ans;
  return 0;
}
