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