import math b = int(input()) n = int(input()) n = math.floor(b / (n * 1000)) print(int(n * 1000))