#include <iostream>
#include <math.h>
using namespace std;

int main() {
    long long a,b,c,m,ost,pot;
    
    cin >> a >> m;
    pot=int(pow(10,m));
    if ((pot%10)==9) pot++;
    if (pot%10==1) pot--;
    ost=a%pot;
    if (ost>=pot/2) a=a-ost+pot;
    else a=a-ost;
    
    cout << a;
    
    
    //system ("pause");
    return 0;
}
