#include using namespace std; int main(){ long long n,m; cin >> n >> m; int i = 1; while(n >= m * i * 1000) i++; cout << (i-1) * 1000 << endl; return 0; }