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