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