n,*d,x,y=`dd`.split.map{|e|e.to_i.abs} x=[x,y].max p x==0 ? 0 : d.include?(x) ? 1 : x>(m=d.max) ? (x+m-1)/m : 2