#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, H_1, H_2, ans = 1;
  cin >> N;
  int data[N];
  for (int i = 0; i < N; i++) cin >> data[i];
  H_1 = data[0];
  H_2 = data[1];
  for (int i = 1; i < N; i++) {
    if (H_1 <= data[i] && H_2 <= data[i] && data[i - 1] && data[i]) ans++;
  }
  cout << ans << endl;
}
