#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
int cx[] = {-1, 1, 0, 0, 1, 1, -1, -1};
int cy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int main() {
  int n, k;
  cin >> n >> k;
  while (k > 0) {
    if (n % 10 > 0) {
      if (k > (n % 10)) {
        k -= (n % 10);
        n -= (n % 10);
      } else {
        n -= k;
        k = 0;
      }
    } else {
      k--;
      n = n / 10;
    }
  }
  cout << n << endl;
}
