L, K = map(int, input().split()) one_eat = K * 2 count = (L - 0.0001) // one_eat yuki_eat = int(count) * K print(yuki_eat)