#include "bits/stdc++.h" using namespace std; #define ll long long #define mp make_pair #define REP(m,n) for(ll i=m;iv; int n; cin>>n; REP(0,n){ int tmp; cin>>tmp; if(i<=2){ v.push_back(tmp); }else{ if(i==2){ v.push_back(v[0]+tmp); }else{ v.push_back(max(v[i-2],v[i-3])+tmp); } } } int ans; if(n==1){ ans=v[n-1]; }else{ ans=max(v[n-1],v[n-2]); } cout<