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