#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t n;
  int k;
  int a;
  cin >> n >> k;
  while (k > 0) {
    a = n % 10;
    if (a == 0) {
      k--;
      n = n / 10;
    } else {
      if (k >= a) {
        k = k - a;
        n = n - a;
      } else {
        n = n - k;
        k = 0;
      }
    }
  }
  if (n < 1) {
    n = 1;
  }
  cout << n;
  return 0;
}
