l,k = gets.chomp.split(" ").map(&:to_i) puts ((l-1)/(k*2))*k