import math L, K = list(map(int, input().split())) cnt = 0 while True: if(L - 2*K <= 0): break else: L -= 2*K cnt += 1 print(cnt*K)