n = gets.to_i
a = gets.chomp.split(" ").map(&:to_i);
num = 1
ans = 0

(n - 1).times do |i|
  if a[i] >= a[i + 1]
    num += 1
    if (num * (num + 1) / 2) % (ans + 1) == 0 
      ans += 1
    end
  end 
end

puts ans