#include <iostream>

using namespace std;

int main()
{
	long long int N, M;
	cin >> N >> M;

	cout << ( N / M / 1000 ) * 1000 << endl;

	return 0;
}