#include <bits/stdc++.h>
int main() {
  int cus, abs, wdw;
  scanf("%d%d", &abs, &wdw);
  for (cus = 0; cus < wdw; cus++) {
    if (abs % 10 == 0) {
      abs /= 10;
    } else {
      abs -= 1;
    }
  }
  printf("%d\n", abs);
  return 0;
}
