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