stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

 

int ar[300005];

int vis[300005];

int main()

{

  int n, i, j=1, ok=0,mi=300005;

 

  cin>>n;

 

  for(i=1; i<=n; i++)

  {

    cin>>ar[i];

  }

 

  for(i=1; i<=n; i++)

  {

    mi=min(ar[i],mi);

    if(mi==ar[i])ok++;

  }

 

  cout<<ok<<endl;

  }


// Faster C++ solution for the same problem (measured speedup: 5.230976236799678x):
#include<stdio.h>



int main()

{

    int N, count=0, min, i=0;



    scanf("%d", &N);



    int P[N+5];



    while(i != N)

    {

        scanf("%d", &P[i]);

        i++;

    }



    if(P[0] <= N)

        {

            count++;

            //printf("1st count = %d\n", count);

            min = P[0];

        }



    for(i=1; i<N; i++)

    {

        if(P[i] < min)

        {

            min = P[i];

            count++;

            //printf("count = %d\nmin = %d=%d\n", count, i, min);

        }

    }



    printf("%d\n", count);



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int n;



int main() {

   scanf("%d" , &n);

   int sol = 0, currMin = INT_MAX;

   for (int i = 0 ; i < n ; i++) {

      int x; scanf("%d" , &x);

      if (currMin == INT_MAX) {

         ++sol;

      } else {

         if (currMin >= x) sol++;

      }

      currMin = min(currMin , x);

   }

   printf("%d\n" , sol);

}


// Faster C++ solution for the same problem (measured speedup: 5.166571082291612x):
#include<stdio.h>



int main()

{

    int N, count=0, min, i=0;



    scanf("%d", &N);



    int P[N+5];



    while(i != N)

    {

        scanf("%d", &P[i]);

        i++;

    }



    if(P[0] <= N)

        {

            count++;

            //printf("1st count = %d\n", count);

            min = P[0];

        }



    for(i=1; i<N; i++)

    {

        if(P[i] < min)

        {

            min = P[i];

            count++;

            //printf("count = %d\nmin = %d=%d\n", count, i, min);

        }

    }



    printf("%d\n", count);



    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

using namespace std;



#define pb push_back

#define F first

#define S second

#define fo(i,a,b)  for(int i = a; i < b; i++)



using ll = long long;

using ld = long double;

using ul = unsigned long long;

using ii = pair<int, int>;

#define Mosta     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define ReadFile            freopen("input.in","r",stdin)

#define WriteFile           freopen("output.txt","w",stdout)

const ll mod7 = 1000000007,mod = 1000000000,OO = 0x3f3f3f3f;

const ld EPS = 1e-7;

double Pi=acos(-1);

const ld rad=Pi/180.0;

ll power(ll x, ll y, ll p)

{

    ll res = 1;

    while (y > 0)

    {

        if (y & 1)

            res = (res*x) % p;

        y = y>>1;

        x = (x*x) % p;

    }

    return res;

}

ll nCr (ll n,ll m)

{

    return(m == 0)?1:n*nCr(n-1,m-1)/m;

}

/*****************************************************/



const int N = (int) 2e5 + 3;



int a[N];



int main()

{

    int n;

    cin >> n;



    for(int i = 0; i < n; ++i)

        cin >> a[i];

    int cnt = 1 , x = a[0];

    for(int i = 1; i < n; ++i){

        x = min(x , a[i]);

        if(a[i] == x)

            cnt++;

    }



    cout << cnt << "\n";



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.23447607813274x):
#include<stdio.h>



int main()

{

    int N, count=0, min, i=0;



    scanf("%d", &N);



    int P[N+5];



    while(i != N)

    {

        scanf("%d", &P[i]);

        i++;

    }



    if(P[0] <= N)

        {

            count++;

            //printf("1st count = %d\n", count);

            min = P[0];

        }



    for(i=1; i<N; i++)

    {

        if(P[i] < min)

        {

            min = P[i];

            count++;

            //printf("count = %d\nmin = %d=%d\n", count, i, min);

        }

    }



    printf("%d\n", count);



    return 0;

}
// Slower C++ solution:
#include "bits/stdc++.h"

#include "sstream"

#define quick ios_base::sync_with_stdio(false);cin.tie(NULL);

using namespace std;

const int N=2e3+1;

int main() {

    quick

int  n,mn=INT_MAX,ans=0,x; cin>>n;

while(n--){

    cin>>x;

    if(x<=mn){mn=min(mn,x),ans++;}

}

cout<<ans;

}

// Faster C++ solution for the same problem (measured speedup: 5.28787355530086x):
#include<stdio.h>



int main()

{

    int N, count=0, min, i=0;



    scanf("%d", &N);



    int P[N+5];



    while(i != N)

    {

        scanf("%d", &P[i]);

        i++;

    }



    if(P[0] <= N)

        {

            count++;

            //printf("1st count = %d\n", count);

            min = P[0];

        }



    for(i=1; i<N; i++)

    {

        if(P[i] < min)

        {

            min = P[i];

            count++;

            //printf("count = %d\nmin = %d=%d\n", count, i, min);

        }

    }



    printf("%d\n", count);



    return 0;

}
// Slower C++ solution:
#include <iostream>

//#include <vector>

#include <algorithm>



using namespace std;



int main(){

    int n, maxNum = 10000000,count=0;

    

    cin>>n;

    for (int i = 0; i < n; i++)

    {

        int x;

        cin>>x;



        if (x<=maxNum)

        {

            count++;

        }

        maxNum = min(x,maxNum);

        



    }



    cout<<count<<endl;

    

}

// Faster C++ solution for the same problem (measured speedup: 5.22997884661435x):
#include<stdio.h>



int main()

{

    int N, count=0, min, i=0;



    scanf("%d", &N);



    int P[N+5];



    while(i != N)

    {

        scanf("%d", &P[i]);

        i++;

    }



    if(P[0] <= N)

        {

            count++;

            //printf("1st count = %d\n", count);

            min = P[0];

        }



    for(i=1; i<N; i++)

    {

        if(P[i] < min)

        {

            min = P[i];

            count++;

            //printf("count = %d\nmin = %d=%d\n", count, i, min);

        }

    }



    printf("%d\n", count);



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;



int main(void)

{

    //freopen("input.txt", "r", stdin);



    int n, i, val, cnt = 1;

    cin >> n;

    int big;

    cin >> big;

    for(i = 1; i < n; i++)

    {

        cin >> val;

        if(val <= big)

        {

            big = val;

            cnt++;

        }

    }

    cout << cnt << "\n";



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.232941429123088x):
#include<stdio.h>



int main()

{

    int N, count=0, min, i=0;



    scanf("%d", &N);



    int P[N+5];



    while(i != N)

    {

        scanf("%d", &P[i]);

        i++;

    }



    if(P[0] <= N)

        {

            count++;

            //printf("1st count = %d\n", count);

            min = P[0];

        }



    for(i=1; i<N; i++)

    {

        if(P[i] < min)

        {

            min = P[i];

            count++;

            //printf("count = %d\nmin = %d=%d\n", count, i, min);

        }

    }



    printf("%d\n", count);



    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

#define ll long long

#include <cmath>

using namespace std;



int main()

{

    int n, temp, i, cnt=0;

    cin >> n;

    int p[n];

    for (i=0; i<n; i++)

    {

        cin >> p[i];

    }

    temp=p[0];

    for (i=0; i<n; i++)

    {

        if (temp>p[i])

        {

            temp=p[i];

            cnt++;

        }

    }

    cout << cnt+1 << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.23085816036137x):
#include<stdio.h>



int main()

{

    int N, count=0, min, i=0;



    scanf("%d", &N);



    int P[N+5];



    while(i != N)

    {

        scanf("%d", &P[i]);

        i++;

    }



    if(P[0] <= N)

        {

            count++;

            //printf("1st count = %d\n", count);

            min = P[0];

        }



    for(i=1; i<N; i++)

    {

        if(P[i] < min)

        {

            min = P[i];

            count++;

            //printf("count = %d\nmin = %d=%d\n", count, i, min);

        }

    }



    printf("%d\n", count);



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define ll long long

#define endl "\n"

using namespace std;



int p[2 * (int)1e5];



int main()

{

    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    

    int n, cnt = 0, least = 2 * (int)1e5 + 1;

    cin >> n;

    

    for (int i = 0; i < n; i++)

    {

        cin >> p[i];

        if (p[i] < least)

        {

            ++cnt;

            least = p[i];

        }

        

    }



    cout << cnt << endl;

    

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.304095002283767x):
#include<stdio.h>



int main()

{

    int N, count=0, min, i=0;



    scanf("%d", &N);



    int P[N+5];



    while(i != N)

    {

        scanf("%d", &P[i]);

        i++;

    }



    if(P[0] <= N)

        {

            count++;

            //printf("1st count = %d\n", count);

            min = P[0];

        }



    for(i=1; i<N; i++)

    {

        if(P[i] < min)

        {

            min = P[i];

            count++;

            //printf("count = %d\nmin = %d=%d\n", count, i, min);

        }

    }



    printf("%d\n", count);



    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



#define ll long long

#define fast_io ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const int N = 2000001;

int arr[N];

int main()

{

    fast_io;

    int n ;

    cin >> n ;

    for(int i = 0; i < n ; i++)

    {

        cin >> arr[i];

    }

    int cnt = 1;

    for(int i = 0 ; i < n - 1 ; i++)

    {

        if(arr[i] > arr[i + 1])

        {

            cnt ++;

        }

        else

        {

            arr [i+1] = arr[i];

        }

    }

    cout << cnt << "\n";



}


// Faster C++ solution for the same problem (measured speedup: 5.304311149449034x):
#include<stdio.h>



int main()

{

    int N, count=0, min, i=0;



    scanf("%d", &N);



    int P[N+5];



    while(i != N)

    {

        scanf("%d", &P[i]);

        i++;

    }



    if(P[0] <= N)

        {

            count++;

            //printf("1st count = %d\n", count);

            min = P[0];

        }



    for(i=1; i<N; i++)

    {

        if(P[i] < min)

        {

            min = P[i];

            count++;

            //printf("count = %d\nmin = %d=%d\n", count, i, min);

        }

    }



    printf("%d\n", count);



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;





int main(void)

{

    ios_base::sync_with_stdio(false);

    cin.tie(0);

    cout.tie(0);

    int n;

    cin >> n;

    int a[n];

    for(int i = 0; i < n; i ++)

    {

        cin >> a[i];

    }

    int count = 1;

    for(int i = 1; i < n; i++)

    {

        if(a[i] < a[i-1])

            count++;

        else

            a[i] = a[i-1];

    }

    cout << count;

}


// Faster C++ solution for the same problem (measured speedup: 5.2893680550124795x):
#include<stdio.h>



int main()

{

    int N, count=0, min, i=0;



    scanf("%d", &N);



    int P[N+5];



    while(i != N)

    {

        scanf("%d", &P[i]);

        i++;

    }



    if(P[0] <= N)

        {

            count++;

            //printf("1st count = %d\n", count);

            min = P[0];

        }



    for(i=1; i<N; i++)

    {

        if(P[i] < min)

        {

            min = P[i];

            count++;

            //printf("count = %d\nmin = %d=%d\n", count, i, min);

        }

    }



    printf("%d\n", count);



    return 0;

}
// Slower C++ solution:
#include <iostream>

#include<algorithm>

#include<string>

#include<vector>

#include<cmath>

#include<map>

using namespace std;

int main()

{

	int num, count = 1, min;

	cin >> num;

	int *arr = new int[num];

	bool smaller = false;

	for (int i = 0; i < num; i++)

		cin >> arr[i];



	min = arr[0];

	for (int i = 1; i < num; i++)

	{

		if (arr[i] <= arr[i - 1] && arr[i] <= min)

		{

			count++;

			min = arr[i];

		}

		

	}

	cout << count << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.238737247126708x):
#include<stdio.h>



int main()

{

    int a,x=1,b,i=0;



    scanf("%d",&a);



    int A[a];



    while(i<a){

        scanf("%d",&A[i]);

        i++;

    }



    b=A[0];

    i=1;



    while(i<a){



        if(A[i]<b)

        {

            b=A[i];

            x++;



        }



        i++;

    }



    printf("%d\n",x);



    return 0;

}
// Slower C++ solution:
//https://blog.csdn.net/hesorchen

// #include <bits/stdc++.h>

#include <iostream>

#include <algorithm>

using namespace std;

#define ll long long

#define mem(a, b) memset(a, b, sizeof(a))

#define lowbit(a) (a & (-a))

#define mod 1000000007

#define endl "\n"



int main()

{

    ll n, minn = 1000000009, a;

    cin >> n;

    ll ans = 0;

    while (n--)

    {

        cin >> a;

        if (a <= minn)

            ans++;

        minn = min(minn, a);

    }

    cout << ans << endl;



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.231286969148954x):
#include<stdio.h>



int main()

{

    int a,x=1,b,i=0;



    scanf("%d",&a);



    int A[a];



    while(i<a){

        scanf("%d",&A[i]);

        i++;

    }



    b=A[0];

    i=1;



    while(i<a){



        if(A[i]<b)

        {

            b=A[i];

            x++;



        }



        i++;

    }



    printf("%d\n",x);



    return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main()

{

	int n;

	cin>>n;

	int min,result=1,temp,i=0;

	cin>>min;

	n--;

	for(;i<n;i++){

		cin>>temp;

		if(temp<min){

			result++;

			min=temp;

		}

	}

	cout<<result<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.232272755653394x):
#include<stdio.h>



int main()

{

    int a,x=1,b,i=0;



    scanf("%d",&a);



    int A[a];



    while(i<a){

        scanf("%d",&A[i]);

        i++;

    }



    b=A[0];

    i=1;



    while(i<a){



        if(A[i]<b)

        {

            b=A[i];

            x++;



        }



        i++;

    }



    printf("%d\n",x);



    return 0;

}
// Slower C++ solution:
#include <iostream>



using namespace std;



int main()

{

    long long n;

    long long num[1000000];

    long long min1;

    long long sum=0;

    cin>>n;

    cin>>num[0];

    min1=num[0];

    for(int i=1;i<n;i++)

    {

        cin>>num[i];

        if(num[i]<min1)

            {

                sum++;

                min1=num[i];

            }

    }

    cout<<sum+1<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 6.186267734974897x):
#include<stdio.h>



int main()

{

    int a,x=1,b,i=0;



    scanf("%d",&a);



    int A[a];



    while(i<a){

        scanf("%d",&A[i]);

        i++;

    }



    b=A[0];

    i=1;



    while(i<a){



        if(A[i]<b)

        {

            b=A[i];

            x++;



        }



        i++;

    }



    printf("%d\n",x);



    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

 

int ar[300005];

int vis[300005];

int main()

{

  int n, i, j=1, ok=0,mi=300005;

 

  cin>>n;

 

  for(i=1; i<=n; i++)

  {

    cin>>ar[i];

  }

 

  for(i=1; i<=n; i++)

  {

    mi=min(ar[i],mi);

    if(mi==ar[i])ok++;

  }

 

  cout<<ok<<endl;

  }


// Faster C++ solution for the same problem (measured speedup: 5.232761511233854x):
#include<stdio.h>



int main()

{

    int a,x=1,b,i=0;



    scanf("%d",&a);



    int A[a];



    while(i<a){

        scanf("%d",&A[i]);

        i++;

    }



    b=A[0];

    i=1;



    while(i<a){



        if(A[i]<b)

        {

            b=A[i];

            x++;



        }



        i++;

    }



    printf("%d\n",x);



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int n;



int main() {

   scanf("%d" , &n);

   int sol = 0, currMin = INT_MAX;

   for (int i = 0 ; i < n ; i++) {

      int x; scanf("%d" , &x);

      if (currMin == INT_MAX) {

         ++sol;

      } else {

         if (currMin >= x) sol++;

      }

      currMin = min(currMin , x);

   }

   printf("%d\n" , sol);

}


// Faster C++ solution for the same problem (measured speedup: 5.168334375957656x):
#include<stdio.h>



int main()

{

    int a,x=1,b,i=0;



    scanf("%d",&a);



    int A[a];



    while(i<a){

        scanf("%d",&A[i]);

        i++;

    }



    b=A[0];

    i=1;



    while(i<a){



        if(A[i]<b)

        {

            b=A[i];

            x++;



        }



        i++;

    }



    printf("%d\n",x);



    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

using namespace std;



#define pb push_back

#define F first

#define S second

#define fo(i,a,b)  for(int i = a; i < b; i++)



using ll = long long;

using ld = long double;

using ul = unsigned long long;

using ii = pair<int, int>;

#define Mosta     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define ReadFile            freopen("input.in","r",stdin)

#define WriteFile           freopen("output.txt","w",stdout)

const ll mod7 = 1000000007,mod = 1000000000,OO = 0x3f3f3f3f;

const ld EPS = 1e-7;

double Pi=acos(-1);

const ld rad=Pi/180.0;

ll power(ll x, ll y, ll p)

{

    ll res = 1;

    while (y > 0)

    {

        if (y & 1)

            res = (res*x) % p;

        y = y>>1;

        x = (x*x) % p;

    }

    return res;

}

ll nCr (ll n,ll m)

{

    return(m == 0)?1:n*nCr(n-1,m-1)/m;

}

/*****************************************************/



const int N = (int) 2e5 + 3;



int a[N];



int main()

{

    int n;

    cin >> n;



    for(int i = 0; i < n; ++i)

        cin >> a[i];

    int cnt = 1 , x = a[0];

    for(int i = 1; i < n; ++i){

        x = min(x , a[i]);

        if(a[i] == x)

            cnt++;

    }



    cout << cnt << "\n";



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.236262547024122x):
#include<stdio.h>



int main()

{

    int a,x=1,b,i=0;



    scanf("%d",&a);



    int A[a];



    while(i<a){

        scanf("%d",&A[i]);

        i++;

    }



    b=A[0];

    i=1;



    while(i<a){



        if(A[i]<b)

        {

            b=A[i];

            x++;



        }



        i++;

    }



    printf("%d\n",x);



    return 0;

}
// Slower C++ solution:
#include "bits/stdc++.h"

#include "sstream"

#define quick ios_base::sync_with_stdio(false);cin.tie(NULL);

using namespace std;

const int N=2e3+1;

int main() {

    quick

int  n,mn=INT_MAX,ans=0,x; cin>>n;

while(n--){

    cin>>x;

    if(x<=mn){mn=min(mn,x),ans++;}

}

cout<<ans;

}

// Faster C++ solution for the same problem (measured speedup: 5.289678248161636x):
#include<stdio.h>



int main()

{

    int a,x=1,b,i=0;



    scanf("%d",&a);



    int A[a];



    while(i<a){

        scanf("%d",&A[i]);

        i++;

    }



    b=A[0];

    i=1;



    while(i<a){



        if(A[i]<b)

        {

            b=A[i];

            x++;



        }



        i++;

    }



    printf("%d\n",x);



    return 0;

}
// Slower C++ solution:
#include <iostream>

//#include <vector>

#include <algorithm>



using namespace std;



int main(){

    int n, maxNum = 10000000,count=0;

    

    cin>>n;

    for (int i = 0; i < n; i++)

    {

        int x;

        cin>>x;



        if (x<=maxNum)

        {

            count++;

        }

        maxNum = min(x,maxNum);

        



    }



    cout<<count<<endl;

    

}

// Faster C++ solution for the same problem (measured speedup: 5.231763780650269x):
#include<stdio.h>



int main()

{

    int a,x=1,b,i=0;



    scanf("%d",&a);



    int A[a];



    while(i<a){

        scanf("%d",&A[i]);

        i++;

    }



    b=A[0];

    i=1;



    while(i<a){



        if(A[i]<b)

        {

            b=A[i];

            x++;



        }



        i++;

    }



    printf("%d\n",x);



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;



int main(void)

{

    //freopen("input.txt", "r", stdin);



    int n, i, val, cnt = 1;

    cin >> n;

    int big;

    cin >> big;

    for(i = 1; i < n; i++)

    {

        cin >> val;

        if(val <= big)

        {

            big = val;

            cnt++;

        }

    }

    cout << cnt << "\n";



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.234727374255707x):
#include<stdio.h>



int main()

{

    int a,x=1,b,i=0;



    scanf("%d",&a);



    int A[a];



    while(i<a){

        scanf("%d",&A[i]);

        i++;

    }



    b=A[0];

    i=1;



    while(i<a){



        if(A[i]<b)

        {

            b=A[i];

            x++;



        }



        i++;

    }



    printf("%d\n",x);



    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

#define ll long long

#include <cmath>

using namespace std;



int main()

{

    int n, temp, i, cnt=0;

    cin >> n;

    int p[n];

    for (i=0; i<n; i++)

    {

        cin >> p[i];

    }

    temp=p[0];

    for (i=0; i<n; i++)

    {

        if (temp>p[i])

        {

            temp=p[i];

            cnt++;

        }

    }

    cout << cnt+1 << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.232643394497363x):
#include<stdio.h>



int main()

{

    int a,x=1,b,i=0;



    scanf("%d",&a);



    int A[a];



    while(i<a){

        scanf("%d",&A[i]);

        i++;

    }



    b=A[0];

    i=1;



    while(i<a){



        if(A[i]<b)

        {

            b=A[i];

            x++;



        }



        i++;

    }



    printf("%d\n",x);



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define ll long long

#define endl "\n"

using namespace std;



int p[2 * (int)1e5];



int main()

{

    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    

    int n, cnt = 0, least = 2 * (int)1e5 + 1;

    cin >> n;

    

    for (int i = 0; i < n; i++)

    {

        cin >> p[i];

        if (p[i] < least)

        {

            ++cnt;

            least = p[i];

        }

        

    }



    cout << cnt << endl;

    

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.305905231345297x):
#include<stdio.h>



int main()

{

    int a,x=1,b,i=0;



    scanf("%d",&a);



    int A[a];



    while(i<a){

        scanf("%d",&A[i]);

        i++;

    }



    b=A[0];

    i=1;



    while(i<a){



        if(A[i]<b)

        {

            b=A[i];

            x++;



        }



        i++;

    }



    printf("%d\n",x);



    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



#define ll long long

#define fast_io ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const int N = 2000001;

int arr[N];

int main()

{

    fast_io;

    int n ;

    cin >> n ;

    for(int i = 0; i < n ; i++)

    {

        cin >> arr[i];

    }

    int cnt = 1;

    for(int i = 0 ; i < n - 1 ; i++)

    {

        if(arr[i] > arr[i + 1])

        {

            cnt ++;

        }

        else

        {

            arr [i+1] = arr[i];

        }

    }

    cout << cnt << "\n";



}


// Faster C++ solution for the same problem (measured speedup: 5.306121452279204x):
#include<stdio.h>



int main()

{

    int a,x=1,b,i=0;



    scanf("%d",&a);



    int A[a];



    while(i<a){

        scanf("%d",&A[i]);

        i++;

    }



    b=A[0];

    i=1;



    while(i<a){



        if(A[i]<b)

        {

            b=A[i];

            x++;



        }



        i++;

    }



    printf("%d\n",x);



    return 0;

}