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