#include <bits/stdc++.h>
using namespace std;
int main() {
#ifdef _DEBUG
freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
#endif
int n, k;
cin >> n >> k;
for (int i = 0; i < k; ++i) {
if (n % 10 == 0) n /= 10;
else n--;
}
cout << n << endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiNpZmRlZiBfREVCVUcKCWZyZW9wZW4oImlucHV0LnR4dCIsICJyIiwgc3RkaW4pOwovLwlmcmVvcGVuKCJvdXRwdXQudHh0IiwgInciLCBzdGRvdXQpOwojZW5kaWYKCglpbnQgbiwgazsKCWNpbiA+PiBuID4+IGs7CgkKCWZvciAoaW50IGkgPSAwOyBpIDwgazsgKytpKSB7CgkJaWYgKG4gJSAxMCA9PSAwKSBuIC89IDEwOwoJCWVsc2Ugbi0tOwoJfQoJCgljb3V0IDw8IG4gPDwgZW5kbDsKCQoJcmV0dXJuIDA7Cn0=