L, K = list(map(int, input().split())) x = L / (2 * K) if x > 1: print(K * int(x)) else: print(0)