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