#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include using namespace std; int main(){ int N; cin>>N; vector S(N-1),A(N,1e9); A[0] = 0; for(int i=0;i>S[i]; S[i]--; for(int j=i+1;j<=S[i];j++) A[j] = min(A[j],A[i]+1); } cout<