N = int(input()) M = int(input()) assert 1 <= N <= 10 ** 16 assert 1 <= M <= 10 ** 16 A = (N // 1000) // M print (A * 1000)