#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	vector<int>arr(n);
	for(int i=0; i<n; i++) cin>>arr[i];
	int before_min = arr[0];
	int ret = 0;
	for(int i=0; i<n; i++){
		before_min = min(before_min,arr[i]);
		if(before_min>=arr[i]) ret++;
	}
	cout<<ret;
}
#include <bits/stdc++.h>

using namespace std;
#define all(a)a.begin(),a.end()
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod = int(1e9)+7;
using V = vector<ll>;
using P = pair<ll,ll>;

int main()
{
   string s;cin >>s;
   string ans="";
   int w;cin >>w;
   for(int i=0;i<(int)s.size();i+=w){
     ans+=s[i];
   }
   cout <<ans << endl;
    return 0;
}
