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