#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, index, replace;
  cin >> n >> k;
  stringstream ss;
  ss << n;
  string s;
  ss >> s;
  index = s.size();
  for (int i = 0; i < k; i++) {
    if (s[index - 1] == '0') {
      s[index - 1] = '\0';
      index--;
    } else {
      replace = (int)s[index - 1];
      replace--;
      s[index - 1] = (char)replace;
    }
  }
  n = atoi(s.c_str());
  cout << n << endl;
}
