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