#include <stdio.h>

int main() {
	long long int n;
	int m;

	scanf("%lld %d", &n, &m);
	printf("%lld\n", n / 1000 / m * 1000);

	return 0;
}