import java.util.Scanner; public class Main{ static int n; static int dp[],v[]; static int res(int x){ if(x>n-1) return 0; else if(dp[x]!=-1) return dp[x]; else if(x==n-1) return v[n-1]; else if(x==n-2) return Math.max(v[n-1], v[n-2]); else return dp[x]=Math.max(res(x+2)+v[x], res(x+1)); } public static void main(String[] args){ Scanner sc=new Scanner(System.in); while(sc.hasNext()){ n=sc.nextInt(); v=new int[n]; for(int i=0;i