#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,fma")
using namespace std;
template <typename T>
using vc = vector<T>;
template <typename T>
using uset = unordered_set<T>;
template <typename A, typename B>
using umap = unordered_map<A, B>;
template <typename T, typename Comp = less<T>>
using pq = priority_queue<T, vc<T>, Comp>;
template <typename T>
using minpq = pq<T, greater<T>>;
using ld = long double;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using ppi = pair<pii, int>;
using pip = pair<int, pii>;
using vi = vc<int>;
using vii = vc<pii>;
constexpr char el = '\n';
constexpr char sp = ' ';
constexpr int INF = 0x3f3f3f3f;
constexpr ll LLINF = 0x3f3f3f3f3f3f3f3fLL;
const int N = 1e5 + 5;
int n, pre[N], suf[N], a[N], b[N];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + n);
  pre[0] = a[0];
  for (int i = 1; i < n; ++i) pre[i] = max(pre[i - 1], a[i]);
  suf[n - 1] = a[n - 1];
  for (int i = n - 2; i >= 0; --i) suf[i] = min(suf[i + 1], a[i]);
  int ans = 1;
  for (int i = 0; i + 1 < n; ++i)
    if (pre[i] <= b[i] && b[i + 1] <= suf[i + 1]) ans++;
  cout << ans;
}
