import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int sum = 0;
    int min = -1;
    ArrayList<Integer> a = new ArrayList<Integer>();
    for (int i=0; i<n;i++){
      int b = scan.nextInt();
      int [] g = put(b,min);
      sum += g[0];
      min = g[1];
    }
    System.out.println(sum);
  }

  public static int[] put(int a, int b){
    int [] g = new int[2];
    if (b == -1){
      g[1] = a;
      g[0] = 1;
      return g;
    }

    if (a <= b){
      g[1] = a;
      g[0] = 1;
      return g;
    }

    g[1] = b;
    g[0] = 0;
    return g;
  }
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz