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