#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int h;
  cin >> h;
  long long int a[h], k[h];
  for (long long int i = 0; i < h; i++) {
    cin >> a[i];
    k[i] = a[i];
  }
  for (long long int i = 0; i < h - 1; i++) {
    if (a[i] > a[i + 1]) a[i + 1] = a[i + 1] + (a[i] - a[i + 1]);
  }
  long long int c = 0;
  for (long long int i = 0; i < h; i++) {
    if (a[i] != k[i]) {
      c = c + 1;
    }
  }
  if (k[0] == k[1]) c = c - 1;
  cout << c + 1;
}
