#include <bits/stdc++.h>
int viewcounter(int *H, int N) {
  int i;
  int j;
  int count;
  i = 0;
  count = 0;
  while (i < N) {
    j = i + 1;
    while (j < N) {
      if (H[j] < H[i]) break;
      j++;
    }
    if (H[j] == 0) count++;
    i++;
  }
  return (count);
}
int main(void) {
  int i;
  int *H;
  int N;
  i = 0;
  scanf("%d", &N);
  H = (int *)malloc(sizeof(int) * (N));
  while (i + 1 < N) {
    scanf("%d ", &H[i]);
    i++;
  }
  scanf("%d", &H[i]);
  printf("%d", viewcounter(H, N));
  free(H);
}
