import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
  		int[] p=new int[n];
    for(int c=0;c<n;c++){
    p[c]=sc.nextInt();
    }
  
    int ans=0;
    int c=p[0];
  
  for(int d=0; d<n-1; d++){
     if(c<p[d+1]){
       ans++; 
     }
    c=Math.min(c,p[d+1]);
    }
     
  
    System.out.println(n-ans);
    
    
   
    }
} import java.util.*; util.* java class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
  		int[] p=new int[n];
    for(int c=0;c<n;c++){
    p[c]=sc.nextInt();
    }
  
    int ans=0;
    int c=p[0];
  
  for(int d=0; d<n-1; d++){
     if(c<p[d+1]){
       ans++; 
     }
    c=Math.min(c,p[d+1]);
    }
     
  
    System.out.println(n-ans);
    
    
   
    }
} Main public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
  		int[] p=new int[n];
    for(int c=0;c<n;c++){
    p[c]=sc.nextInt();
    }
  
    int ans=0;
    int c=p[0];
  
  for(int d=0; d<n-1; d++){
     if(c<p[d+1]){
       ans++; 
     }
    c=Math.min(c,p[d+1]);
    }
     
  
    System.out.println(n-ans);
    
    
   
    } main {
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
  		int[] p=new int[n];
    for(int c=0;c<n;c++){
    p[c]=sc.nextInt();
    }
  
    int ans=0;
    int c=p[0];
  
  for(int d=0; d<n-1; d++){
     if(c<p[d+1]){
       ans++; 
     }
    c=Math.min(c,p[d+1]);
    }
     
  
    System.out.println(n-ans);
    
    
   
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] p=new int[n]; p new int[n] n for(int c=0;c<n;c++){
    p[c]=sc.nextInt();
    } int c=0; int c=0; c 0 c<n c n c++ c++ c {
    p[c]=sc.nextInt();
    } {
    p[c]=sc.nextInt();
    } p[c]=sc.nextInt() p[c] p c sc.nextInt() sc.nextInt sc int ans=0; ans 0 int c=p[0]; c p[0] p 0 for(int d=0; d<n-1; d++){
     if(c<p[d+1]){
       ans++; 
     }
    c=Math.min(c,p[d+1]);
    } int d=0; int d=0; d 0 d<n-1 d n-1 n 1 d++ d++ d {
     if(c<p[d+1]){
       ans++; 
     }
    c=Math.min(c,p[d+1]);
    } {
     if(c<p[d+1]){
       ans++; 
     }
    c=Math.min(c,p[d+1]);
    } if(c<p[d+1]){
       ans++; 
     } c<p[d+1] c p[d+1] p d+1 d 1 {
       ans++; 
     } ans++ ans c=Math.min(c,p[d+1]) c Math.min(c,p[d+1]) Math.min Math c p[d+1] p d+1 d 1 System.out.println(n-ans) System.out.println System.out System System.out n-ans n ans String[] args args
import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
  		int[] p=new int[n];
    for(int c=0;c<n;c++){
    p[c]=sc.nextInt();
    }
  
    int ans=0;
    int c=p[0];
  
  for(int d=0; d<n-1; d++){
     if(c<p[d+1]){
       ans++; 
     }
    c=Math.min(c,p[d+1]);
    }
     
  
    System.out.println(n-ans);
    
    
   
    }
}