#include using namespace std; typedef long long ll; int main() { ll N, M; cin >> N >> M; N /= 1000; ll ans = N / M * 1000; cout << ans << endl; }