#include #define rep(i,a,b) for(int i=int(a);i> N; vectorV(N),dp(N+2); rep(i,0,N)cin >> V[i]; dp[0] = V[0]; dp[1] = N == 1 ? V[0] : max(V[0],V[1]); rep(i,2,N){ dp[i] = max(dp[i-2] + V[i], dp[i-1] ); } cout << dp[N-1] << endl; }