#include <bits/stdc++.h>
using namespace std;
long long INF = 1e7;
int mod = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  string n, m;
  cin >> n >> m;
  long long a = stoll(n);
  long long b = stoll(m);
  long long upper = ++a;
  long long i = 10;
  while (a % i <= b) {
    upper = upper - (upper % i);
    i *= 10;
  }
  cout << upper - 1;
}
