import std.algorithm;
import std.bigint;
import std.concurrency;
import std.container;
import std.conv;
import std.functional;
import std.format;
import std.math;
import std.meta;
import std.numeric;
import std.random;
import std.range;
import std.stdio;
import std.string;
import std.traits;
import std.typecons;


auto solve(long N, long[] H) {
    return zip(H, H.fold!max).count!"a[0] == a[1]";
}


auto fold(alias f, R)(R range) {
    alias T = ElementType!R;
    
    static struct Result {
    private:
        R source;
        T state;

        this(R range) {
            source = range;
            if (source.empty)
                return;

            state = source.front;
        }

    public:
        @property bool empty() {
            return source.empty;
        }

        @property T front() {
            assert(!empty, "Attempting to fetch the front of an empty cumulativeFold.");
            return state;
        }

        void popFront() {
            assert(!empty, "Attempting to popFront an empty cumulativeFold.");
            source.popFront;

            if (source.empty)
                return;

            state = f(state, source.front);
        }

        static if (isForwardRange!R) {
            @property auto save()
            {
                auto result = this;
                result.source = source.save;
                return result;
            }
        }

        static if (hasLength!R) {
            @property size_t length()
            {
                return source.length;
            }
        }
    }

    return Result(range);
}


void main() {
    auto input = stdin.byLine.map!split.joiner;

    long N;
    N = input.front.to!long;
    input.popFront;

    long[] H = new long[](cast(size_t) (N));
    foreach (i; 0 .. cast(size_t) (N)) {
        H[i] = input.front.to!long;
        input.popFront;
    }

    static if (is(ReturnType!solve == void))
        solve(N, H);
    else
        solve(N, H).writeln;
}
