read n; read m; echo $((n/1000/m*1000))