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