#include <bits/stdc++.h>
using namespace std;
int a, b, c, n, m, k, ans, cnt;
string s, s1;
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    if (n % 10 == 0)
      n /= 10;
    else
      n--;
  }
  cout << n;
}
