#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int n, k;
  cin >> n >> k;
  unsigned long long int t;
  while (k) {
    if (n % 10 == 0) {
      n /= 10;
      k--;
    }
    t = min(n % 10, k);
    n -= t;
    k -= t;
  }
  cout << n;
  return 0;
}
