#include <bits/stdc++.h>

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);

  string s;
  int w;
  cin >> s >> w;
  int n = s.length();

  string ans;
  for (int i = 0; i < n; i += w) {
    ans += s[i];
  }
  cout << ans << '\n';

  return 0;
}

#include <bits/stdc++.h>
using namespace std; 
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(a) (a).begin(),(a).end()
#define ll long long
long long min(long long x,long long y){return (x<y ? x:y);}
long long max(long long x,long long y){return (x>y ? x:y);}
#define ld long double
int stoi(string s) {return atoi(s.c_str());}
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
#define LINEY "YES\n"
#define Liney "Yes\n"
#define LINEN "NO\n"
#define Linen "No\n"

int main(){
  int N,K; cin>>N>>K;
  int r = N-K+1;
  printf("%d\n",r);
}