#include int main(){ long long int a,b; scanf("%lld%lld",&a,&b); printf("%lld",a/1000/b*1000); return 0; }