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