#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  ;
  int n, k;
  cin >> n >> k;
  while (n > 0 && k > 0) {
    k--;
    if (n % 10 == 0)
      n = n / 10;
    else
      n--;
  }
  cout << n << "\n";
  return 0;
}
