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