#include<iostream>
using namespace std;
int main(void){
	long long int n, m; cin >> n >> m;
	cout << ((n / 1000) / m * 1000) << endl;
	return 0;
}