n = int(input()) m = int(input()) o = 0 n = round(n/1000)*1000 o = int(n / m) o = round(o/1000)*1000 print(o)