#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using PP = pair<ll, P>;
using VB = vector<bool>;
using VI = vector<ll>;
using VS = vector<string>;
using VC = vector<char>;
using VP = vector<P>;
using VPP = vector<PP>;
using VD = vector<double>;
using VVI = vector<VI>;
using VVP = vector<VP>;
using VVC = vector<VC>;
using VVB = vector<VB>;
using VVVI = vector<VVI>;
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < k; i++) {
    if (n % 10 == 0)
      n /= 10;
    else
      n--;
  }
  cout << n << endl;
}
