#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  long long n;
  int k;
  while (cin >> n >> k) {
    for (int i = 0; i < k; ++i) {
      if (n % 10 != 0) {
        n -= 1;
        continue;
      }
      if (n % 10 == 0) {
        n /= 10;
        continue;
      }
    }
    cout << n << endl;
  }
}
