#include "bits/stdc++.h" using namespace std; int main() { int N, M; cin >> N >> M; N /= 1000; cout << (N / M * 1000) << endl; }