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