#include <stdio.h>
int main(void)
{
	int a,b;
	scanf("%ld%d",&a,&b);
	printf("%ld",a/1000/b*1000);
	return 0;
}