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