// NOTE: it is recommended to use this even if you don't understand the following code.
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
// uncomment the two following lines if you want to read/write from files
// ifstream cin("input.txt");
// ofstream cout("output.txt");
int N;
cin >> N;
vector<int> S(N);
for (int i = 0; i < N; ++i)
cin >> S[i];
int ans = N;
for (int i=0; i<N; i++)
{
if(S[N-1]>S[i]){
ans--;}
S[N]=S[i];
}
cout << ans << endl;
return 0;
}
Ly8gTk9URTogaXQgaXMgcmVjb21tZW5kZWQgdG8gdXNlIHRoaXMgZXZlbiBpZiB5b3UgZG9uJ3QgdW5kZXJzdGFuZCB0aGUgZm9sbG93aW5nIGNvZGUuCgojaW5jbHVkZSA8ZnN0cmVhbT4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewogICAgLy8gdW5jb21tZW50IHRoZSB0d28gZm9sbG93aW5nIGxpbmVzIGlmIHlvdSB3YW50IHRvIHJlYWQvd3JpdGUgZnJvbSBmaWxlcwogICAgLy8gaWZzdHJlYW0gY2luKCJpbnB1dC50eHQiKTsKICAgIC8vIG9mc3RyZWFtIGNvdXQoIm91dHB1dC50eHQiKTsKCiAgICBpbnQgTjsKICAgIGNpbiA+PiBOOwoKICAgIHZlY3RvcjxpbnQ+IFMoTik7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IE47ICsraSkKICAgICAgICBjaW4gPj4gU1tpXTsKCiAgICBpbnQgYW5zID0gTjsKCgogICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykKICAgIHsKICAgIAlpZihTW04tMV0+U1tpXSl7CiAgICAJCiAgICAJYW5zLS07fQogICAgCVNbTl09U1tpXTsKICAgIAkKCX0KCQoKCiAgICBjb3V0IDw8IGFucyA8PCBlbmRsOwoKICAgIHJldHVybiAwOwp9Cg==