#include int main() { long long n,m; scanf("%lld %lld",&n,&m); printf("%lld\n",n/1000/m*1000); }