import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author varunvats32
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CLowElements solver = new CLowElements();
        solver.solve(1, in, out);
        out.close();
    }

    static class CLowElements {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] arr = new int[n];

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            int min = arr[0];
            int count = 0;

            for (int i = 0; i < n; i++) {
                if (arr[i] > min) {
                    count++;
                }
                min = Math.min(min, arr[i]);
            }

            out.println(n - count);
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CLowElements solver = new CLowElements();
        solver.solve(1, in, out);
        out.close();
    }

    static class CLowElements {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] arr = new int[n];

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            int min = arr[0];
            int count = 0;

            for (int i = 0; i < n; i++) {
                if (arr[i] > min) {
                    count++;
                }
                min = Math.min(min, arr[i]);
            }

            out.println(n - count);
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CLowElements solver = new CLowElements();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CLowElements solver = new CLowElements();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) CLowElements solver = new CLowElements(); solver new CLowElements() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class CLowElements {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] arr = new int[n];

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            int min = arr[0];
            int count = 0;

            for (int i = 0; i < n; i++) {
                if (arr[i] > min) {
                    count++;
                }
                min = Math.min(min, arr[i]);
            }

            out.println(n - count);
        }

    } CLowElements public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] arr = new int[n];

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            int min = arr[0];
            int count = 0;

            for (int i = 0; i < n; i++) {
                if (arr[i] > min) {
                    count++;
                }
                min = Math.min(min, arr[i]);
            }

            out.println(n - count);
        } solve {
            int n = in.nextInt();
            int[] arr = new int[n];

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            int min = arr[0];
            int count = 0;

            for (int i = 0; i < n; i++) {
                if (arr[i] > min) {
                    count++;
                }
                min = Math.min(min, arr[i]);
            }

            out.println(n - count);
        } int n = in.nextInt(); n in.nextInt() in.nextInt in int[] arr = new int[n]; arr new int[n] n for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                arr[i] = in.nextInt();
            } {
                arr[i] = in.nextInt();
            } arr[i] = in.nextInt() arr[i] arr i in.nextInt() in.nextInt in int min = arr[0]; min arr[0] arr 0 int count = 0; count 0 for (int i = 0; i < n; i++) {
                if (arr[i] > min) {
                    count++;
                }
                min = Math.min(min, arr[i]);
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                if (arr[i] > min) {
                    count++;
                }
                min = Math.min(min, arr[i]);
            } {
                if (arr[i] > min) {
                    count++;
                }
                min = Math.min(min, arr[i]);
            } if (arr[i] > min) {
                    count++;
                } arr[i] > min arr[i] arr i min {
                    count++;
                } count++ count min = Math.min(min, arr[i]) min Math.min(min, arr[i]) Math.min Math min arr[i] arr i out.println(n - count) out.println out n - count n count int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CLowElements solver = new CLowElements();
        solver.solve(1, in, out);
        out.close();
    }

    static class CLowElements {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] arr = new int[n];

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            int min = arr[0];
            int count = 0;

            for (int i = 0; i < n; i++) {
                if (arr[i] > min) {
                    count++;
                }
                min = Math.min(min, arr[i]);
            }

            out.println(n - count);
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CLowElements solver = new CLowElements();
        solver.solve(1, in, out);
        out.close();
    }

    static class CLowElements {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] arr = new int[n];

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            int min = arr[0];
            int count = 0;

            for (int i = 0; i < n; i++) {
                if (arr[i] > min) {
                    count++;
                }
                min = Math.min(min, arr[i]);
            }

            out.println(n - count);
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author varunvats32
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CLowElements solver = new CLowElements();
        solver.solve(1, in, out);
        out.close();
    }

    static class CLowElements {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] arr = new int[n];

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            int min = arr[0];
            int count = 0;

            for (int i = 0; i < n; i++) {
                if (arr[i] > min) {
                    count++;
                }
                min = Math.min(min, arr[i]);
            }

            out.println(n - count);
        }

    }
}

