#include <bits/stdc++.h>
using namespace std;
int mov_y[] = {1, 0, -1, 0};
int mov_x[] = {0, 1, 0, -1};
vector<pair<long long, long long> > v;
map<int, int> mp;
set<char> st;
long long a[(int)1000005], cnt[(int)1000005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(6);
  int x, k;
  cin >> x >> k;
  while (k--) {
    if (x % 10 == 0)
      x /= 10;
    else
      x--;
  }
  cout << x;
}
