//package com.company;
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    public class Main{
        public static class FastReader {
            private InputStream stream;
            private byte[] buf = new byte[1024];
            private int curChar;
            private int numChars;
            private SpaceCharFilter filter;
            public FastReader(InputStream stream) {
                this.stream = stream;
            }
            public int read() {
                if (numChars==-1)
                    throw new InputMismatchException();
                if (curChar >= numChars) {
                    curChar = 0;
                    try {
                        numChars = stream.read(buf);
                    }
                    catch (IOException e) {
                        throw new InputMismatchException();
                    }
                    if(numChars <= 0)
                        return -1;
                }
                return buf[curChar++];
            }
            public String nextLine() {
                BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                String str = "";
                try {
                    str = br.readLine();
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
                return str;
            }
            public int nextInt() {
                int c = read();
                while(isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                int res = 0;
                do {
                    if(c<'0'||c>'9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c));
                return res * sgn;
            }
            public long nextLong() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                long res = 0;
                do {
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c));
                return res * sgn;
            }
            public double nextDouble() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                double res = 0;
                while (!isSpaceChar(c) && c != '.') {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                if (c == '.') {
                    c = read();
                    double m = 1;
                    while (!isSpaceChar(c))
                    {
                        if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt());
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        m /= 10;
                        res += (c - '0') * m;
                        c = read();
                    }
                }
                return res * sgn;
            }
            public char nextChar() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                return (char)c;
            }
            public String next() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                StringBuilder res = new StringBuilder();
                do {
                    res.appendCodePoint(c);
                    c = read();
                }
                while (!isSpaceChar(c));
                return res.toString();
            }
            public boolean isSpaceChar(int c) {
                if (filter != null)
                    return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
            }
            public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
            }
        }
        static long gcd(long a, long b){ 
            if (a == 0) 
                return b;  
            return gcd(b % a, a);  
        } 
        static long lcm(long a, long b)  {
            return (a*b)/gcd(a, b);  
        } 
        static long func(long a[],long size,int s){
            long max1=a[s];
            long maxc=a[s];
            for(int i=s+1;i<size;i++){
                maxc=Math.max(a[i],maxc+a[i]);
                max1=Math.max(maxc,max1);
            }
            return max1;
        }
        public static void main(String args[]){
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastReader in = new FastReader(inputStream);
            PrintWriter w = new PrintWriter(outputStream);
            int n,i,j,min1=0;
          n=in.nextInt();
          int arr[]=new int[n];
          int min[]=new int[n];
          for(i=0;i<n;i++){
            arr[i]=in.nextInt();
          }
          min[0]=arr[0];
          min1=arr[0];
          for(i=1;i<n;i++){
            if(min1>arr[i]){
              min1=arr[i];
              min[i]=min1;
            }else{
              min[i]=min1;
            }
          }
          int c=0;
       	  for(i=0;i<n;i++){
            if(min[i]>=arr[i]){
              c++;
            }
          }
          w.println(c);
            w.close();
        }
        
    } import java.io.*; io.* java import java.util.*; util.* java import java.lang.*; lang.* java public class Main{
        public static class FastReader {
            private InputStream stream;
            private byte[] buf = new byte[1024];
            private int curChar;
            private int numChars;
            private SpaceCharFilter filter;
            public FastReader(InputStream stream) {
                this.stream = stream;
            }
            public int read() {
                if (numChars==-1)
                    throw new InputMismatchException();
                if (curChar >= numChars) {
                    curChar = 0;
                    try {
                        numChars = stream.read(buf);
                    }
                    catch (IOException e) {
                        throw new InputMismatchException();
                    }
                    if(numChars <= 0)
                        return -1;
                }
                return buf[curChar++];
            }
            public String nextLine() {
                BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                String str = "";
                try {
                    str = br.readLine();
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
                return str;
            }
            public int nextInt() {
                int c = read();
                while(isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                int res = 0;
                do {
                    if(c<'0'||c>'9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c));
                return res * sgn;
            }
            public long nextLong() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                long res = 0;
                do {
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c));
                return res * sgn;
            }
            public double nextDouble() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                double res = 0;
                while (!isSpaceChar(c) && c != '.') {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                if (c == '.') {
                    c = read();
                    double m = 1;
                    while (!isSpaceChar(c))
                    {
                        if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt());
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        m /= 10;
                        res += (c - '0') * m;
                        c = read();
                    }
                }
                return res * sgn;
            }
            public char nextChar() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                return (char)c;
            }
            public String next() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                StringBuilder res = new StringBuilder();
                do {
                    res.appendCodePoint(c);
                    c = read();
                }
                while (!isSpaceChar(c));
                return res.toString();
            }
            public boolean isSpaceChar(int c) {
                if (filter != null)
                    return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
            }
            public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
            }
        }
        static long gcd(long a, long b){ 
            if (a == 0) 
                return b;  
            return gcd(b % a, a);  
        } 
        static long lcm(long a, long b)  {
            return (a*b)/gcd(a, b);  
        } 
        static long func(long a[],long size,int s){
            long max1=a[s];
            long maxc=a[s];
            for(int i=s+1;i<size;i++){
                maxc=Math.max(a[i],maxc+a[i]);
                max1=Math.max(maxc,max1);
            }
            return max1;
        }
        public static void main(String args[]){
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastReader in = new FastReader(inputStream);
            PrintWriter w = new PrintWriter(outputStream);
            int n,i,j,min1=0;
          n=in.nextInt();
          int arr[]=new int[n];
          int min[]=new int[n];
          for(i=0;i<n;i++){
            arr[i]=in.nextInt();
          }
          min[0]=arr[0];
          min1=arr[0];
          for(i=1;i<n;i++){
            if(min1>arr[i]){
              min1=arr[i];
              min[i]=min1;
            }else{
              min[i]=min1;
            }
          }
          int c=0;
       	  for(i=0;i<n;i++){
            if(min[i]>=arr[i]){
              c++;
            }
          }
          w.println(c);
            w.close();
        }
        
    } Main static long gcd(long a, long b){ 
            if (a == 0) 
                return b;  
            return gcd(b % a, a);  
        } gcd { 
            if (a == 0) 
                return b;  
            return gcd(b % a, a);  
        } if (a == 0) 
                return b; a == 0 a 0 return b; b return gcd(b % a, a); gcd(b % a, a) gcd b % a b a a long a a long b b static long lcm(long a, long b)  {
            return (a*b)/gcd(a, b);  
        } lcm {
            return (a*b)/gcd(a, b);  
        } return (a*b)/gcd(a, b); (a*b)/gcd(a, b) (a*b) a b gcd(a, b) gcd a b long a a long b b static long func(long a[],long size,int s){
            long max1=a[s];
            long maxc=a[s];
            for(int i=s+1;i<size;i++){
                maxc=Math.max(a[i],maxc+a[i]);
                max1=Math.max(maxc,max1);
            }
            return max1;
        } func {
            long max1=a[s];
            long maxc=a[s];
            for(int i=s+1;i<size;i++){
                maxc=Math.max(a[i],maxc+a[i]);
                max1=Math.max(maxc,max1);
            }
            return max1;
        } long max1=a[s]; max1 a[s] a s long maxc=a[s]; maxc a[s] a s for(int i=s+1;i<size;i++){
                maxc=Math.max(a[i],maxc+a[i]);
                max1=Math.max(maxc,max1);
            } int i=s+1; int i=s+1; i s+1 s 1 i<size i size i++ i++ i {
                maxc=Math.max(a[i],maxc+a[i]);
                max1=Math.max(maxc,max1);
            } {
                maxc=Math.max(a[i],maxc+a[i]);
                max1=Math.max(maxc,max1);
            } maxc=Math.max(a[i],maxc+a[i]) maxc Math.max(a[i],maxc+a[i]) Math.max Math a[i] a i maxc+a[i] maxc a[i] a i max1=Math.max(maxc,max1) max1 Math.max(maxc,max1) Math.max Math maxc max1 return max1; max1 long a[] a long size size int s s public static void main(String args[]){
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastReader in = new FastReader(inputStream);
            PrintWriter w = new PrintWriter(outputStream);
            int n,i,j,min1=0;
          n=in.nextInt();
          int arr[]=new int[n];
          int min[]=new int[n];
          for(i=0;i<n;i++){
            arr[i]=in.nextInt();
          }
          min[0]=arr[0];
          min1=arr[0];
          for(i=1;i<n;i++){
            if(min1>arr[i]){
              min1=arr[i];
              min[i]=min1;
            }else{
              min[i]=min1;
            }
          }
          int c=0;
       	  for(i=0;i<n;i++){
            if(min[i]>=arr[i]){
              c++;
            }
          }
          w.println(c);
            w.close();
        } main {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastReader in = new FastReader(inputStream);
            PrintWriter w = new PrintWriter(outputStream);
            int n,i,j,min1=0;
          n=in.nextInt();
          int arr[]=new int[n];
          int min[]=new int[n];
          for(i=0;i<n;i++){
            arr[i]=in.nextInt();
          }
          min[0]=arr[0];
          min1=arr[0];
          for(i=1;i<n;i++){
            if(min1>arr[i]){
              min1=arr[i];
              min[i]=min1;
            }else{
              min[i]=min1;
            }
          }
          int c=0;
       	  for(i=0;i<n;i++){
            if(min[i]>=arr[i]){
              c++;
            }
          }
          w.println(c);
            w.close();
        } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out FastReader in = new FastReader(inputStream); in new FastReader(inputStream) PrintWriter w = new PrintWriter(outputStream); w new PrintWriter(outputStream) int n n i i j j min1=0; min1 0 n=in.nextInt() n in.nextInt() in.nextInt in int arr[]=new int[n]; arr new int[n] n int min[]=new int[n]; min new int[n] n for(i=0;i<n;i++){
            arr[i]=in.nextInt();
          } i=0; 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 min[0]=arr[0] min[0] min 0 arr[0] arr 0 min1=arr[0] min1 arr[0] arr 0 for(i=1;i<n;i++){
            if(min1>arr[i]){
              min1=arr[i];
              min[i]=min1;
            }else{
              min[i]=min1;
            }
          } i=1; i=1 i 1 i<n i n i++ i++ i {
            if(min1>arr[i]){
              min1=arr[i];
              min[i]=min1;
            }else{
              min[i]=min1;
            }
          } {
            if(min1>arr[i]){
              min1=arr[i];
              min[i]=min1;
            }else{
              min[i]=min1;
            }
          } if(min1>arr[i]){
              min1=arr[i];
              min[i]=min1;
            }else{
              min[i]=min1;
            } min1>arr[i] min1 arr[i] arr i {
              min1=arr[i];
              min[i]=min1;
            } min1=arr[i] min1 arr[i] arr i min[i]=min1 min[i] min i min1 {
              min[i]=min1;
            } min[i]=min1 min[i] min i min1 int c=0; c 0 for(i=0;i<n;i++){
            if(min[i]>=arr[i]){
              c++;
            }
          } i=0; i=0 i 0 i<n i n i++ i++ i {
            if(min[i]>=arr[i]){
              c++;
            }
          } {
            if(min[i]>=arr[i]){
              c++;
            }
          } if(min[i]>=arr[i]){
              c++;
            } min[i]>=arr[i] min[i] min i arr[i] arr i {
              c++;
            } c++ c w.println(c) w.println w c w.close() w.close w String args[] args public static class FastReader {
            private InputStream stream;
            private byte[] buf = new byte[1024];
            private int curChar;
            private int numChars;
            private SpaceCharFilter filter;
            public FastReader(InputStream stream) {
                this.stream = stream;
            }
            public int read() {
                if (numChars==-1)
                    throw new InputMismatchException();
                if (curChar >= numChars) {
                    curChar = 0;
                    try {
                        numChars = stream.read(buf);
                    }
                    catch (IOException e) {
                        throw new InputMismatchException();
                    }
                    if(numChars <= 0)
                        return -1;
                }
                return buf[curChar++];
            }
            public String nextLine() {
                BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                String str = "";
                try {
                    str = br.readLine();
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
                return str;
            }
            public int nextInt() {
                int c = read();
                while(isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                int res = 0;
                do {
                    if(c<'0'||c>'9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c));
                return res * sgn;
            }
            public long nextLong() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                long res = 0;
                do {
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c));
                return res * sgn;
            }
            public double nextDouble() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                double res = 0;
                while (!isSpaceChar(c) && c != '.') {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                if (c == '.') {
                    c = read();
                    double m = 1;
                    while (!isSpaceChar(c))
                    {
                        if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt());
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        m /= 10;
                        res += (c - '0') * m;
                        c = read();
                    }
                }
                return res * sgn;
            }
            public char nextChar() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                return (char)c;
            }
            public String next() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                StringBuilder res = new StringBuilder();
                do {
                    res.appendCodePoint(c);
                    c = read();
                }
                while (!isSpaceChar(c));
                return res.toString();
            }
            public boolean isSpaceChar(int c) {
                if (filter != null)
                    return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
            }
            public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
            }
        } FastReader private InputStream stream; stream private byte[] buf = new byte[1024]; buf new byte[1024] 1024 private int curChar; curChar private int numChars; numChars private SpaceCharFilter filter; filter public FastReader(InputStream stream) {
                this.stream = stream;
            } FastReader {
                this.stream = stream;
            } this.stream = stream this.stream this this.stream stream InputStream stream stream public int read() {
                if (numChars==-1)
                    throw new InputMismatchException();
                if (curChar >= numChars) {
                    curChar = 0;
                    try {
                        numChars = stream.read(buf);
                    }
                    catch (IOException e) {
                        throw new InputMismatchException();
                    }
                    if(numChars <= 0)
                        return -1;
                }
                return buf[curChar++];
            } read {
                if (numChars==-1)
                    throw new InputMismatchException();
                if (curChar >= numChars) {
                    curChar = 0;
                    try {
                        numChars = stream.read(buf);
                    }
                    catch (IOException e) {
                        throw new InputMismatchException();
                    }
                    if(numChars <= 0)
                        return -1;
                }
                return buf[curChar++];
            } if (numChars==-1)
                    throw new InputMismatchException(); numChars==-1 numChars -1 1 throw new InputMismatchException(); new InputMismatchException() if (curChar >= numChars) {
                    curChar = 0;
                    try {
                        numChars = stream.read(buf);
                    }
                    catch (IOException e) {
                        throw new InputMismatchException();
                    }
                    if(numChars <= 0)
                        return -1;
                } curChar >= numChars curChar numChars {
                    curChar = 0;
                    try {
                        numChars = stream.read(buf);
                    }
                    catch (IOException e) {
                        throw new InputMismatchException();
                    }
                    if(numChars <= 0)
                        return -1;
                } curChar = 0 curChar 0 try {
                        numChars = stream.read(buf);
                    }
                    catch (IOException e) {
                        throw new InputMismatchException();
                    } catch (IOException e) {
                        throw new InputMismatchException();
                    } IOException e {
                        throw new InputMismatchException();
                    } throw new InputMismatchException(); new InputMismatchException() {
                        numChars = stream.read(buf);
                    } numChars = stream.read(buf) numChars stream.read(buf) stream.read stream buf if(numChars <= 0)
                        return -1; numChars <= 0 numChars 0 return -1; -1 1 return buf[curChar++]; buf[curChar++] buf curChar++ curChar public String nextLine() {
                BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                String str = "";
                try {
                    str = br.readLine();
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
                return str;
            } nextLine {
                BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                String str = "";
                try {
                    str = br.readLine();
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
                return str;
            } BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str = ""; str "" try {
                    str = br.readLine();
                }
                catch (IOException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                } IOException e {
                    e.printStackTrace();
                } e.printStackTrace() e.printStackTrace e {
                    str = br.readLine();
                } str = br.readLine() str br.readLine() br.readLine br return str; str public int nextInt() {
                int c = read();
                while(isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                int res = 0;
                do {
                    if(c<'0'||c>'9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c));
                return res * sgn;
            } nextInt {
                int c = read();
                while(isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                int res = 0;
                do {
                    if(c<'0'||c>'9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c));
                return res * sgn;
            } int c = read(); c read() read while(isSpaceChar(c))
                    c = read(); isSpaceChar(c) isSpaceChar c c = read() c read() read int sgn = 1; sgn 1 if (c == '-') {
                    sgn = -1;
                    c = read();
                } c == '-' c '-' {
                    sgn = -1;
                    c = read();
                } sgn = -1 sgn -1 1 c = read() c read() read int res = 0; res 0 do {
                    if(c<'0'||c>'9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
                    if(c<'0'||c>'9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                } if(c<'0'||c>'9')
                        throw new InputMismatchException(); c<'0'||c>'9' c<'0' c '0' c>'9' c '9' throw new InputMismatchException(); new InputMismatchException() res *= 10 res 10 res += c - '0' res c - '0' c '0' c = read() c read() read return res * sgn; res * sgn res sgn public long nextLong() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                long res = 0;
                do {
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c));
                return res * sgn;
            } nextLong {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                long res = 0;
                do {
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c));
                return res * sgn;
            } int c = read(); c read() read while (isSpaceChar(c))
                    c = read(); isSpaceChar(c) isSpaceChar c c = read() c read() read int sgn = 1; sgn 1 if (c == '-') {
                    sgn = -1;
                    c = read();
                } c == '-' c '-' {
                    sgn = -1;
                    c = read();
                } sgn = -1 sgn -1 1 c = read() c read() read long res = 0; res 0 do {
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                } if (c < '0' || c > '9')
                        throw new InputMismatchException(); c < '0' || c > '9' c < '0' c '0' c > '9' c '9' throw new InputMismatchException(); new InputMismatchException() res *= 10 res 10 res += c - '0' res c - '0' c '0' c = read() c read() read return res * sgn; res * sgn res sgn public double nextDouble() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                double res = 0;
                while (!isSpaceChar(c) && c != '.') {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                if (c == '.') {
                    c = read();
                    double m = 1;
                    while (!isSpaceChar(c))
                    {
                        if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt());
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        m /= 10;
                        res += (c - '0') * m;
                        c = read();
                    }
                }
                return res * sgn;
            } nextDouble {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                double res = 0;
                while (!isSpaceChar(c) && c != '.') {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                if (c == '.') {
                    c = read();
                    double m = 1;
                    while (!isSpaceChar(c))
                    {
                        if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt());
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        m /= 10;
                        res += (c - '0') * m;
                        c = read();
                    }
                }
                return res * sgn;
            } int c = read(); c read() read while (isSpaceChar(c))
                    c = read(); isSpaceChar(c) isSpaceChar c c = read() c read() read int sgn = 1; sgn 1 if (c == '-') {
                    sgn = -1;
                    c = read();
                } c == '-' c '-' {
                    sgn = -1;
                    c = read();
                } sgn = -1 sgn -1 1 c = read() c read() read double res = 0; res 0 while (!isSpaceChar(c) && c != '.') {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                } !isSpaceChar(c) && c != '.' !isSpaceChar(c) isSpaceChar(c) isSpaceChar c c != '.' c '.' {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                } if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt()); c == 'e' || c == 'E' c == 'e' c 'e' c == 'E' c 'E' return res * Math.pow(10, nextInt()); res * Math.pow(10, nextInt()) res Math.pow(10, nextInt()) Math.pow Math 10 nextInt() nextInt if (c < '0' || c > '9')
                        throw new InputMismatchException(); c < '0' || c > '9' c < '0' c '0' c > '9' c '9' throw new InputMismatchException(); new InputMismatchException() res *= 10 res 10 res += c - '0' res c - '0' c '0' c = read() c read() read if (c == '.') {
                    c = read();
                    double m = 1;
                    while (!isSpaceChar(c))
                    {
                        if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt());
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        m /= 10;
                        res += (c - '0') * m;
                        c = read();
                    }
                } c == '.' c '.' {
                    c = read();
                    double m = 1;
                    while (!isSpaceChar(c))
                    {
                        if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt());
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        m /= 10;
                        res += (c - '0') * m;
                        c = read();
                    }
                } c = read() c read() read double m = 1; m 1 while (!isSpaceChar(c))
                    {
                        if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt());
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        m /= 10;
                        res += (c - '0') * m;
                        c = read();
                    } !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
                        if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt());
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        m /= 10;
                        res += (c - '0') * m;
                        c = read();
                    } if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt()); c == 'e' || c == 'E' c == 'e' c 'e' c == 'E' c 'E' return res * Math.pow(10, nextInt()); res * Math.pow(10, nextInt()) res Math.pow(10, nextInt()) Math.pow Math 10 nextInt() nextInt if (c < '0' || c > '9')
                            throw new InputMismatchException(); c < '0' || c > '9' c < '0' c '0' c > '9' c '9' throw new InputMismatchException(); new InputMismatchException() m /= 10 m 10 res += (c - '0') * m res (c - '0') * m (c - '0') c '0' m c = read() c read() read return res * sgn; res * sgn res sgn public char nextChar() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                return (char)c;
            } nextChar {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                return (char)c;
            } int c = read(); c read() read while (isSpaceChar(c))
                    c = read(); isSpaceChar(c) isSpaceChar c c = read() c read() read return (char)c; (char)c public String next() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                StringBuilder res = new StringBuilder();
                do {
                    res.appendCodePoint(c);
                    c = read();
                }
                while (!isSpaceChar(c));
                return res.toString();
            } next {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                StringBuilder res = new StringBuilder();
                do {
                    res.appendCodePoint(c);
                    c = read();
                }
                while (!isSpaceChar(c));
                return res.toString();
            } int c = read(); c read() read while (isSpaceChar(c))
                    c = read(); isSpaceChar(c) isSpaceChar c c = read() c read() read StringBuilder res = new StringBuilder(); res new StringBuilder() do {
                    res.appendCodePoint(c);
                    c = read();
                }
                while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
                    res.appendCodePoint(c);
                    c = read();
                } res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res public boolean isSpaceChar(int c) {
                if (filter != null)
                    return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
            } isSpaceChar {
                if (filter != null)
                    return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
            } if (filter != null)
                    return filter.isSpaceChar(c); filter != null filter null return filter.isSpaceChar(c); filter.isSpaceChar(c) filter.isSpaceChar filter c return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == '\t' c == '\r' c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == ' ' c ' ' c == '\n' c '\n' c == '\r' c '\r' c == '\t' c '\t' c == -1 c -1 1 int c c public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
            } SpaceCharFilter public boolean isSpaceChar(int ch); isSpaceChar int ch ch public class Main{
        public static class FastReader {
            private InputStream stream;
            private byte[] buf = new byte[1024];
            private int curChar;
            private int numChars;
            private SpaceCharFilter filter;
            public FastReader(InputStream stream) {
                this.stream = stream;
            }
            public int read() {
                if (numChars==-1)
                    throw new InputMismatchException();
                if (curChar >= numChars) {
                    curChar = 0;
                    try {
                        numChars = stream.read(buf);
                    }
                    catch (IOException e) {
                        throw new InputMismatchException();
                    }
                    if(numChars <= 0)
                        return -1;
                }
                return buf[curChar++];
            }
            public String nextLine() {
                BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                String str = "";
                try {
                    str = br.readLine();
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
                return str;
            }
            public int nextInt() {
                int c = read();
                while(isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                int res = 0;
                do {
                    if(c<'0'||c>'9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c));
                return res * sgn;
            }
            public long nextLong() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                long res = 0;
                do {
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c));
                return res * sgn;
            }
            public double nextDouble() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                double res = 0;
                while (!isSpaceChar(c) && c != '.') {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                if (c == '.') {
                    c = read();
                    double m = 1;
                    while (!isSpaceChar(c))
                    {
                        if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt());
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        m /= 10;
                        res += (c - '0') * m;
                        c = read();
                    }
                }
                return res * sgn;
            }
            public char nextChar() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                return (char)c;
            }
            public String next() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                StringBuilder res = new StringBuilder();
                do {
                    res.appendCodePoint(c);
                    c = read();
                }
                while (!isSpaceChar(c));
                return res.toString();
            }
            public boolean isSpaceChar(int c) {
                if (filter != null)
                    return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
            }
            public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
            }
        }
        static long gcd(long a, long b){ 
            if (a == 0) 
                return b;  
            return gcd(b % a, a);  
        } 
        static long lcm(long a, long b)  {
            return (a*b)/gcd(a, b);  
        } 
        static long func(long a[],long size,int s){
            long max1=a[s];
            long maxc=a[s];
            for(int i=s+1;i<size;i++){
                maxc=Math.max(a[i],maxc+a[i]);
                max1=Math.max(maxc,max1);
            }
            return max1;
        }
        public static void main(String args[]){
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastReader in = new FastReader(inputStream);
            PrintWriter w = new PrintWriter(outputStream);
            int n,i,j,min1=0;
          n=in.nextInt();
          int arr[]=new int[n];
          int min[]=new int[n];
          for(i=0;i<n;i++){
            arr[i]=in.nextInt();
          }
          min[0]=arr[0];
          min1=arr[0];
          for(i=1;i<n;i++){
            if(min1>arr[i]){
              min1=arr[i];
              min[i]=min1;
            }else{
              min[i]=min1;
            }
          }
          int c=0;
       	  for(i=0;i<n;i++){
            if(min[i]>=arr[i]){
              c++;
            }
          }
          w.println(c);
            w.close();
        }
        
    } public class Main{
        public static class FastReader {
            private InputStream stream;
            private byte[] buf = new byte[1024];
            private int curChar;
            private int numChars;
            private SpaceCharFilter filter;
            public FastReader(InputStream stream) {
                this.stream = stream;
            }
            public int read() {
                if (numChars==-1)
                    throw new InputMismatchException();
                if (curChar >= numChars) {
                    curChar = 0;
                    try {
                        numChars = stream.read(buf);
                    }
                    catch (IOException e) {
                        throw new InputMismatchException();
                    }
                    if(numChars <= 0)
                        return -1;
                }
                return buf[curChar++];
            }
            public String nextLine() {
                BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                String str = "";
                try {
                    str = br.readLine();
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
                return str;
            }
            public int nextInt() {
                int c = read();
                while(isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                int res = 0;
                do {
                    if(c<'0'||c>'9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c));
                return res * sgn;
            }
            public long nextLong() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                long res = 0;
                do {
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c));
                return res * sgn;
            }
            public double nextDouble() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                double res = 0;
                while (!isSpaceChar(c) && c != '.') {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                if (c == '.') {
                    c = read();
                    double m = 1;
                    while (!isSpaceChar(c))
                    {
                        if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt());
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        m /= 10;
                        res += (c - '0') * m;
                        c = read();
                    }
                }
                return res * sgn;
            }
            public char nextChar() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                return (char)c;
            }
            public String next() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                StringBuilder res = new StringBuilder();
                do {
                    res.appendCodePoint(c);
                    c = read();
                }
                while (!isSpaceChar(c));
                return res.toString();
            }
            public boolean isSpaceChar(int c) {
                if (filter != null)
                    return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
            }
            public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
            }
        }
        static long gcd(long a, long b){ 
            if (a == 0) 
                return b;  
            return gcd(b % a, a);  
        } 
        static long lcm(long a, long b)  {
            return (a*b)/gcd(a, b);  
        } 
        static long func(long a[],long size,int s){
            long max1=a[s];
            long maxc=a[s];
            for(int i=s+1;i<size;i++){
                maxc=Math.max(a[i],maxc+a[i]);
                max1=Math.max(maxc,max1);
            }
            return max1;
        }
        public static void main(String args[]){
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastReader in = new FastReader(inputStream);
            PrintWriter w = new PrintWriter(outputStream);
            int n,i,j,min1=0;
          n=in.nextInt();
          int arr[]=new int[n];
          int min[]=new int[n];
          for(i=0;i<n;i++){
            arr[i]=in.nextInt();
          }
          min[0]=arr[0];
          min1=arr[0];
          for(i=1;i<n;i++){
            if(min1>arr[i]){
              min1=arr[i];
              min[i]=min1;
            }else{
              min[i]=min1;
            }
          }
          int c=0;
       	  for(i=0;i<n;i++){
            if(min[i]>=arr[i]){
              c++;
            }
          }
          w.println(c);
            w.close();
        }
        
    } Main
//package com.company;
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    public class Main{
        public static class FastReader {
            private InputStream stream;
            private byte[] buf = new byte[1024];
            private int curChar;
            private int numChars;
            private SpaceCharFilter filter;
            public FastReader(InputStream stream) {
                this.stream = stream;
            }
            public int read() {
                if (numChars==-1)
                    throw new InputMismatchException();
                if (curChar >= numChars) {
                    curChar = 0;
                    try {
                        numChars = stream.read(buf);
                    }
                    catch (IOException e) {
                        throw new InputMismatchException();
                    }
                    if(numChars <= 0)
                        return -1;
                }
                return buf[curChar++];
            }
            public String nextLine() {
                BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                String str = "";
                try {
                    str = br.readLine();
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
                return str;
            }
            public int nextInt() {
                int c = read();
                while(isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                int res = 0;
                do {
                    if(c<'0'||c>'9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c));
                return res * sgn;
            }
            public long nextLong() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                long res = 0;
                do {
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                while (!isSpaceChar(c));
                return res * sgn;
            }
            public double nextDouble() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                double res = 0;
                while (!isSpaceChar(c) && c != '.') {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                if (c == '.') {
                    c = read();
                    double m = 1;
                    while (!isSpaceChar(c))
                    {
                        if (c == 'e' || c == 'E')
                            return res * Math.pow(10, nextInt());
                        if (c < '0' || c > '9')
                            throw new InputMismatchException();
                        m /= 10;
                        res += (c - '0') * m;
                        c = read();
                    }
                }
                return res * sgn;
            }
            public char nextChar() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                return (char)c;
            }
            public String next() {
                int c = read();
                while (isSpaceChar(c))
                    c = read();
                StringBuilder res = new StringBuilder();
                do {
                    res.appendCodePoint(c);
                    c = read();
                }
                while (!isSpaceChar(c));
                return res.toString();
            }
            public boolean isSpaceChar(int c) {
                if (filter != null)
                    return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
            }
            public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
            }
        }
        static long gcd(long a, long b){ 
            if (a == 0) 
                return b;  
            return gcd(b % a, a);  
        } 
        static long lcm(long a, long b)  {
            return (a*b)/gcd(a, b);  
        } 
        static long func(long a[],long size,int s){
            long max1=a[s];
            long maxc=a[s];
            for(int i=s+1;i<size;i++){
                maxc=Math.max(a[i],maxc+a[i]);
                max1=Math.max(maxc,max1);
            }
            return max1;
        }
        public static void main(String args[]){
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastReader in = new FastReader(inputStream);
            PrintWriter w = new PrintWriter(outputStream);
            int n,i,j,min1=0;
          n=in.nextInt();
          int arr[]=new int[n];
          int min[]=new int[n];
          for(i=0;i<n;i++){
            arr[i]=in.nextInt();
          }
          min[0]=arr[0];
          min1=arr[0];
          for(i=1;i<n;i++){
            if(min1>arr[i]){
              min1=arr[i];
              min[i]=min1;
            }else{
              min[i]=min1;
            }
          }
          int c=0;
       	  for(i=0;i<n;i++){
            if(min[i]>=arr[i]){
              c++;
            }
          }
          w.println(c);
            w.close();
        }
        
    }