n = gets.to_i x = gets.split.map(&:to_i).sort k = x.pop puts x.inject(k){|s,v| s + v / 2 }