// yukicoder: No.128 お年玉(1) // 2019.4.11 bal4u #include int main() { long long N; int M; scanf("%lld%d", &N, &M); printf("%lld\n", N / (1000 * M)*1000); return 0; }