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