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