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