n = gets.to_i a = gets.split.map(&:to_i).uniq m = a.max.to_s(2).length count = m m.times{|i| if a.all?{|v|v[i] == 0} count -= 1 end } p 1 << count