#include main(){ long long N,M; scanf("%lld %d",&N,&M); N /= 1000LL; printf("%d",N/M*1000); }