#include <bits/stdc++.h>
int main() {
  unsigned long long int n;
  unsigned long long int i;
  std::cin >> n >> i;
  while (i != 0) {
    if (n % 10 == 0) {
      n /= 10;
    } else {
      n -= 1;
    }
    i--;
  }
  std::cout << n;
  return 0;
}
