#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, h[100010], a[100010], res = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> h[i], a[i] = h[i];
  sort(a + 1, a + n + 1);
  int sum1 = 0, sum2 = 0;
  for (int i = 1; i <= n; i++)
    sum1 += h[i], sum2 += a[i], res += (sum1 == sum2);
  cout << res << endl;
  return 0;
}
