#include <bits/stdc++.h>
int main() {
  int N;
  scanf("%d", &N);
  int H[N];
  int i;
  for (i = 0; i < N; i++) scanf("%d", &H[i]);
  int ans = 1, boo = 1;
  i = N - 1;
  while (boo == 1 && 1 <= i) {
    if (H[i - 1] <= H[i])
      ans += 1;
    else
      boo = 0;
    i -= 1;
  }
  printf("%d", ans);
  return 0;
}
