#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void umax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
inline void umin(T &a, T b) {
  if (a > b) a = b;
}
const int N = 200000;
int n, res;
int a[N], b[N], s1, s2;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i], b[i] = a[i];
  sort(b + 1, b + n + 1);
  for (int i = 1; i <= n; i++) s1 += a[i], s2 += b[i], res += (s1 == s2);
  cout << res;
  return !1;
}
