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