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