#include <bits/stdc++.h>
using namespace std;
int judge(long long x) {
  int pre = x % 10;
  if (pre == 0)
    return 1;
  else
    return 0;
}
int main() {
  long long n;
  int k;
  cin >> n >> k;
  for (int i = 0; i < k; i++) {
    int jud = judge(n);
    if (jud == 1)
      n = n / 10;
    else if (jud == 0)
      n--;
  }
  cout << n << endl;
}
