#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int m;
  int k;
  cin >> m >> k;
  while (k) {
    int a = m % 10;
    if (a == 0) {
      m /= 10;
      k--;
    } else {
      m -= 1;
      k--;
    }
  }
  cout << m << endl;
}
