#include #include #include using namespace std; int main(){ int N;cin>>N; vector V(N); for(int i=0;i>V[i]; vector W(N+1,0); W[0]=0; W[1]=V[0]; for(int i=2;i<=N;i++){ W[i]=max(W[i-1],W[i-2]+V[i-1]); } cout << W[N] << endl; return 0; }