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