#include <bits/stdc++.h>
using namespace std;
long long n, k;
void solve() {
  cin >> n >> k;
  while (k--) {
    if (n % 10 == 0)
      n = n / 10;
    else if (n % 2 == 0 || n % 1 == 0)
      n = n - 1;
  }
  cout << n;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
