long long a;main(b){scanf("%lld%d",&a,&b);a=!printf("%lld",a/1000/b*1000);}