n = gets.to_i
a = gets.split.map(&:to_i)
b = Hash.new(0)
ans = 1
r = 0
for i in 1..n-1
    next if a[i] > a[i-1]
    if r > 0
        r = r-1 < a[i] ? r-1 : a[i]
    else
        ans += 1
        r = a[i]-1
    end
end
puts ans