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