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