N = int(input()) M = int(input()) N //= 1000 x = N//M print(x*1000)