import math N=float(input()) M=float(input()) N/=1000 N=int(math.floor(N/M)) print(N*1000)