#include <bits/stdc++.h>
using namespace std;
int main() {
  int num, num_oper;
  cin >> num;
  cin >> num_oper;
  while (num_oper != 0) {
    if ((num % 10) == 0) {
      num /= 10;
    } else {
      num--;
    }
    num_oper--;
  }
  cout << num;
  return 0;
}
