import java.io.*; import java.util.*; class Main{ public static void main(String[] args) throws IOException{ Scanner scan=new Scanner(System.in); int n=scan.nextInt(); int[] a=new int[n+5]; int[] dp=new int[n+5]; for(int i=0;i1){ dp[i]=Math.max(dp[i-1],dp[i-2]+a[i]); } } System.out.println(dp[n-1]); } }