a, b = gets.split.map &:to_i if a%b == 0 && a/b%2 == 0 p (a / b / 2 - 1) * b else p a / b / 2 * b end