#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, i;
  cin >> a >> b;
  for (i = 0; i < b; i++) {
    if (a % 10 == 0) {
      c = a / 10;
      a = c;
    } else {
      c = a - 1;
      a = c;
    }
  }
  cout << a;
  return 0;
}
