#include <bits/stdc++.h>
unsigned long long Number;
unsigned long long OP;
int main() {
  scanf("%llu%llu", &Number, &OP);
  while (OP) {
    if (Number % 10 == 0)
      Number /= 10;
    else
      --Number;
    --OP;
  }
  printf("%llu", Number);
  return 0;
}
