l, k = gets.split(' ').map(&:to_i) k2 = k * 2 times = l / k2 if times == 1 times = 0 if l % k2 == 0 end puts times * k