#include <bits/stdc++.h>
using namespace std;
void reopen(const string& name) {
  char fn[256];
  sprintf(fn, "%s.in", name.c_str());
  freopen(fn, "r", stdin);
  sprintf(fn, "%s.out", name.c_str());
  freopen(fn, "w", stdout);
}
const long long oo = 0x3f3f3f3f3f3f3f3fll;
const int LGN = 25;
const int MOD = 1e9 + 7;
const int N = 2e5 + 5;
const int NLGN = N * LGN;
int main() {
  std::ios::sync_with_stdio(false);
  int n, k;
  scanf("%d%d", &(n), &(k));
  for (long long i = 1, __R = k; i <= __R; i++) {
    if ((n % 10) == 0) {
      n = n / 10;
    } else {
      n--;
    }
  }
  printf("%d\n", n);
  return 0;
}
