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