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