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