N, M = map(int, open(0).read().split()) print((N // 1000) // M * 1000)