local ffi = require 'ffi' local C = ffi.C ffi.cdef [[ long atol(const char *str); int printf(const char *fmt, ...); ]] C.printf("%ld\n", (function (n, m) if n < m * 1000LL then return 0LL end return n/m - n/m%1000 end)(C.atol(io.stdin:read("*l")), C.atol(io.stdin:read("*l"))))