#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define eps 0.00000001 #define LONG_INF 10000000000000000 #define GOLD 1.61803398874989484820458 #define MAX_MOD 1000000007 #define f(n) for(int i=0;i> n; vector hoge; REP(i,n){ int tmp; cin >> tmp; hoge.push_back(tmp); } if(n >= 3){ for(int i = 2;i < n;++i){ hoge[i] = max(hoge[i-1],hoge[i-2]+hoge[i]); } } cout << hoge[n-1] << endl; return 0; }