// Arup Guha
// 6/13/2024
// Solution to Kattis Problem: Pivot
// https://open.kattis.com/problems/pivot

using namespace std;
#include <bits/stdc++.h>

int main() {

    int n;
    cin >> n;
    vector<int> vals(n);
    vector<int> maxv(n);
    vector<int> minv(n);

    // Read in values.
    for (int i=0; i<n; i++)
        cin >> vals[i];

    // Calculate max from left.
    maxv[0] = vals[0];
    for (int i=1; i<n; i++)
        maxv[i] = max(maxv[i-1], vals[i]);

    // Calculate min from right.
    minv[n-1] = vals[n-1];
    for (int i=n-2; i>=0; i--)
        minv[i] = min(minv[i+1], vals[i]);

    // Both values at an index have to be the same to work.
    int res = 0;
    for (int i=0; i<n; i++)
        if (minv[i] == maxv[i])
            res++;

    // Ta da!
    cout << res << endl;

    return 0;
}
