l, k = gets.chomp!.split(' ').map(&:to_i) yuu = 0 loop do break if (l -= 2 * k) <= 0 yuu += k end puts yuu