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