(l, k) = list(map(int, input().split())) count = 0 while True: if l - (k * 2) <= 0: break else: count += 1 l -= k * 2 print(count * k)