import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.nextLine());
        String[] arrays = sc.nextLine().split(" ");
        sc.close();

        int count = 0;
        long tmpMax = Long.parseLong(arrays[0]);

        for (int i = 0; i < N; i++) {
            long Pi = Long.parseLong(arrays[i]);
            if (tmpMax >= Pi) {
                count++;
                tmpMax = Pi;
            } else {
                continue;
            }
        }

        System.out.println(count);

    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.nextLine());
        String[] arrays = sc.nextLine().split(" ");
        sc.close();

        int count = 0;
        long tmpMax = Long.parseLong(arrays[0]);

        for (int i = 0; i < N; i++) {
            long Pi = Long.parseLong(arrays[i]);
            if (tmpMax >= Pi) {
                count++;
                tmpMax = Pi;
            } else {
                continue;
            }
        }

        System.out.println(count);

    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.nextLine());
        String[] arrays = sc.nextLine().split(" ");
        sc.close();

        int count = 0;
        long tmpMax = Long.parseLong(arrays[0]);

        for (int i = 0; i < N; i++) {
            long Pi = Long.parseLong(arrays[i]);
            if (tmpMax >= Pi) {
                count++;
                tmpMax = Pi;
            } else {
                continue;
            }
        }

        System.out.println(count);

    } main {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.nextLine());
        String[] arrays = sc.nextLine().split(" ");
        sc.close();

        int count = 0;
        long tmpMax = Long.parseLong(arrays[0]);

        for (int i = 0; i < N; i++) {
            long Pi = Long.parseLong(arrays[i]);
            if (tmpMax >= Pi) {
                count++;
                tmpMax = Pi;
            } else {
                continue;
            }
        }

        System.out.println(count);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = Long.parseLong(sc.nextLine()); N Long.parseLong(sc.nextLine()) Long.parseLong Long sc.nextLine() sc.nextLine sc String[] arrays = sc.nextLine().split(" "); arrays sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " sc.close() sc.close sc int count = 0; count 0 long tmpMax = Long.parseLong(arrays[0]); tmpMax Long.parseLong(arrays[0]) Long.parseLong Long arrays[0] arrays 0 for (int i = 0; i < N; i++) {
            long Pi = Long.parseLong(arrays[i]);
            if (tmpMax >= Pi) {
                count++;
                tmpMax = Pi;
            } else {
                continue;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            long Pi = Long.parseLong(arrays[i]);
            if (tmpMax >= Pi) {
                count++;
                tmpMax = Pi;
            } else {
                continue;
            }
        } {
            long Pi = Long.parseLong(arrays[i]);
            if (tmpMax >= Pi) {
                count++;
                tmpMax = Pi;
            } else {
                continue;
            }
        } long Pi = Long.parseLong(arrays[i]); Pi Long.parseLong(arrays[i]) Long.parseLong Long arrays[i] arrays i if (tmpMax >= Pi) {
                count++;
                tmpMax = Pi;
            } else {
                continue;
            } tmpMax >= Pi tmpMax Pi {
                count++;
                tmpMax = Pi;
            } count++ count tmpMax = Pi tmpMax Pi {
                continue;
            } continue; System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.nextLine());
        String[] arrays = sc.nextLine().split(" ");
        sc.close();

        int count = 0;
        long tmpMax = Long.parseLong(arrays[0]);

        for (int i = 0; i < N; i++) {
            long Pi = Long.parseLong(arrays[i]);
            if (tmpMax >= Pi) {
                count++;
                tmpMax = Pi;
            } else {
                continue;
            }
        }

        System.out.println(count);

    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.nextLine());
        String[] arrays = sc.nextLine().split(" ");
        sc.close();

        int count = 0;
        long tmpMax = Long.parseLong(arrays[0]);

        for (int i = 0; i < N; i++) {
            long Pi = Long.parseLong(arrays[i]);
            if (tmpMax >= Pi) {
                count++;
                tmpMax = Pi;
            } else {
                continue;
            }
        }

        System.out.println(count);

    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.nextLine());
        String[] arrays = sc.nextLine().split(" ");
        sc.close();

        int count = 0;
        long tmpMax = Long.parseLong(arrays[0]);

        for (int i = 0; i < N; i++) {
            long Pi = Long.parseLong(arrays[i]);
            if (tmpMax >= Pi) {
                count++;
                tmpMax = Pi;
            } else {
                continue;
            }
        }

        System.out.println(count);

    }

}