#include int main(){ int N, M; int money; scanf("%d", &N); scanf("%d", &M); money = (N / M / 1000) * 1000; printf("%d\n", money); return 0; }