#include <bits/stdc++.h>
using namespace std;
int main() {
  int number{};
  int noOfSubstraction{};
  cin >> number >> noOfSubstraction;
  for (int i = 0; i < noOfSubstraction; i++) {
    if (number % 10 == 0) {
      number = number / 10;
    } else {
      number -= 1;
    }
  }
  cout << number;
}
