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"))))