import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		// 入力値
		int n = sc.nextInt();
		int[] p = new int[n];
		for(int i=0;i<n;i++){
			p[i] = sc.nextInt();
		}
		sc.close();
		int r = n;
		int max = p[0];
		for(int i=0;i<n;i++){
			if(max<p[i]){
				r--;
			}else{
				max = p[i];
			}
		}
		System.out.println(r);
	}
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		// 入力値
		int n = sc.nextInt();
		int[] p = new int[n];
		for(int i=0;i<n;i++){
			p[i] = sc.nextInt();
		}
		sc.close();
		int r = n;
		int max = p[0];
		for(int i=0;i<n;i++){
			if(max<p[i]){
				r--;
			}else{
				max = p[i];
			}
		}
		System.out.println(r);
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		// 入力値
		int n = sc.nextInt();
		int[] p = new int[n];
		for(int i=0;i<n;i++){
			p[i] = sc.nextInt();
		}
		sc.close();
		int r = n;
		int max = p[0];
		for(int i=0;i<n;i++){
			if(max<p[i]){
				r--;
			}else{
				max = p[i];
			}
		}
		System.out.println(r);
	} main {
		Scanner sc = new Scanner(System.in);
		// 入力値
		int n = sc.nextInt();
		int[] p = new int[n];
		for(int i=0;i<n;i++){
			p[i] = sc.nextInt();
		}
		sc.close();
		int r = n;
		int max = p[0];
		for(int i=0;i<n;i++){
			if(max<p[i]){
				r--;
			}else{
				max = p[i];
			}
		}
		System.out.println(r);
	} 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 i=0;i<n;i++){
			p[i] = sc.nextInt();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			p[i] = sc.nextInt();
		} {
			p[i] = sc.nextInt();
		} p[i] = sc.nextInt() p[i] p i sc.nextInt() sc.nextInt sc sc.close() sc.close sc int r = n; r n int max = p[0]; max p[0] p 0 for(int i=0;i<n;i++){
			if(max<p[i]){
				r--;
			}else{
				max = p[i];
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			if(max<p[i]){
				r--;
			}else{
				max = p[i];
			}
		} {
			if(max<p[i]){
				r--;
			}else{
				max = p[i];
			}
		} if(max<p[i]){
				r--;
			}else{
				max = p[i];
			} max<p[i] max p[i] p i {
				r--;
			} r-- r {
				max = p[i];
			} max = p[i] max p[i] p i System.out.println(r) System.out.println System.out System System.out r String[] args args public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		// 入力値
		int n = sc.nextInt();
		int[] p = new int[n];
		for(int i=0;i<n;i++){
			p[i] = sc.nextInt();
		}
		sc.close();
		int r = n;
		int max = p[0];
		for(int i=0;i<n;i++){
			if(max<p[i]){
				r--;
			}else{
				max = p[i];
			}
		}
		System.out.println(r);
	}
} public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		// 入力値
		int n = sc.nextInt();
		int[] p = new int[n];
		for(int i=0;i<n;i++){
			p[i] = sc.nextInt();
		}
		sc.close();
		int r = n;
		int max = p[0];
		for(int i=0;i<n;i++){
			if(max<p[i]){
				r--;
			}else{
				max = p[i];
			}
		}
		System.out.println(r);
	}
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		// 入力値
		int n = sc.nextInt();
		int[] p = new int[n];
		for(int i=0;i<n;i++){
			p[i] = sc.nextInt();
		}
		sc.close();
		int r = n;
		int max = p[0];
		for(int i=0;i<n;i++){
			if(max<p[i]){
				r--;
			}else{
				max = p[i];
			}
		}
		System.out.println(r);
	}
}