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