#include <bits/stdc++.h>
using namespace std;
struct abc {
  long long int z, y, x;
};
bool compare(abc a1, abc a2) {
  if (a1.x == a2.x) return a1.y < a2.y;
  return a1.x < a2.x;
}
bool compare1(abc a1, abc a2) { return a1.x > a2.x; }
bool compare2(abc a1, abc a2) { return a1.y < a2.y; }
long long int countDivisors(long long int n) {
  long long int cnt = 0;
  for (long long int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        cnt++;
      else
        cnt = cnt + 2;
    }
  }
  return cnt;
}
const long long int mod = 1e9 + 7;
long long int n, m, x, y, l, r, ans, k, q, w, h;
string second, p;
map<long long int, long long int> mp;
void solve() {
  cin >> n;
  long long int a[n];
  multiset<long long int, greater<long long int>> ms;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    ms.insert(a[i]);
  }
  long long int x = a[n - 1];
  for (long long int i = n - 2; i >= 0; i--) {
    ms.erase(ms.find(a[i + 1]));
    x = min(x, a[i + 1]);
    if (x >= *ms.begin()) ans++;
  }
  cout << ans + 1;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
}
