n=gets.to_i
a=gets.split.map &:to_i

q=[]
(1...a.size).each{|i|
  q<<a[i] if a[i-1]>=a[i]
}

p (1..100).bsearch{|k|
  h=Hash.new(1)
  q.all?{|x|
    h.delete_if{|k,v|k>x}
    x.downto(1).any?{|y|
      h[y]<k && h[y]+=1
    }
  }
}