import java.util.Scanner; public class Main { @SuppressWarnings("resource") public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int v[]=new int[n+2]; for(int i=2;i<=n+1;i++){ v[i]=scanner.nextInt(); } dfs(0,0,v); System.out.println(sum); } static int sum=0; private static void dfs(int i,int sc,int[] v) { sum=Math.max(sum, sc); for(int j=i+2;j