#include <iostream>

using namespace std;

int main() {
	long long n, m;
	cin >> n >> m;
	cout << n / (m * 1000LL) * 1000LL << endl;
	return 0;
}