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