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