l, k = gets.split(' ').map(&:to_i) i = 0 k2 = k * 2 while l - k2 > 0 l -= k2 i += 1 end puts k * i