(defparameter N (parse-integer (read-line)))
(defparameter M (parse-integer (read-line)))

(format 't "~d~%" (* (floor (floor N M) 1000) 1000))