l, k = gets.chomp.split.map &:to_i p (l == 2 * k) ? 0 : ((l.to_f / 2).to_i / k * k)