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