Language: C

using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	const double eps=1e-11;
	static void Main(){
		Sc sc=new Sc();
		var n=sc.I;
		var a=sc.La2;
		var dp=new long[n+1][];
		dp[0]=new long[2];
		dp[1]=new long[]{0,a[1]};
		for(int i = 2;i<=n;i++) {
			dp[i]=new long[]{long.MinValue+10,long.MinValue+10};
			if(i%2==0){
				for(int j = i-2;j>=i-3&&j>=0;j--) {
					dp[i][0]=Max(dp[i][0],dp[j][1]);
				}
				dp[i][0]+=a[i];
				dp[i][1]=dp[i][0];
			}
			else{
				for(int j = i-2;j>=i-4&&j>=0;j--) {
					dp[i][0]=Max(dp[i][0],j==i-4?dp[j][1]:dp[j][0]);
				}
				dp[i][0]+=a[i];
				for(int j = i-2;j>=i-2&&j>=0;j--) {
					dp[i][1]=Max(dp[i][1],dp[j][1]);
				}
				dp[i][1]+=a[i];
			}
		}
		long ans=dp[n][0];
		for(int i = n-1;i>=n-1-(n%2)&&i>0;i--) {
			ans=Max(ans,dp[i][1]);
		}
		Console.WriteLine("{0}",ans);
	}
}
public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),int.Parse);}
	public int[] Ia3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public double[] Da2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),double.Parse);}}
	public double[] Da3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),double.Parse);}
	public double[] Da3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),double.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}

Compiler output:
main.c:1:1: error: unknown type name 'using'
    1 | using System;
      | ^~~~~
main.c:2:1: error: unknown type name 'using'
    2 | using System.Collections.Generic;
      | ^~~~~
main.c:2:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | using System.Collections.Generic;
      |             ^
main.c:3:1: error: unknown type name 'using'
    3 | using System.Collections;
      | ^~~~~
main.c:3:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | using System.Collections;
      |             ^
main.c:4:1: error: unknown type name 'using'
    4 | using System.Collections.Specialized;
      | ^~~~~
main.c:4:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    4 | using System.Collections.Specialized;
      |             ^
main.c:5:1: error: unknown type name 'using'
    5 | using System.Linq;
      | ^~~~~
main.c:5:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    5 | using System.Linq;
      |             ^
main.c:6:1: error: unknown type name 'using'
    6 | using System.Text;
      | ^~~~~
main.c:6:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    6 | using System.Text;
      |             ^
main.c:7:1: error: unknown type name 'using'
    7 | using System.IO;
      | ^~~~~
main.c:7:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    7 | using System.IO;
      |             ^
main.c:8:1: error: unknown type name 'using'
    8 | using System.Reflection;
      | ^~~~~
main.c:8:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    8 | using System.Reflection;
      |             ^
main.c:9:6: error: expected ';' before 'static'
    9 | using static System.Math;
      |      ^~~~~~~
      |      ;
main.c:9:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    9 | using static System.Math;
      |                    ^
main.c:10:1: error: unknown type name 'using'
   10 | using System.Numerics;
      | ^~~~~
main.c:10:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   10 | using System.Numerics;
      |             ^
main.c:11:8: error: unknown type name 'class'
   11 | static class Program{
      |        ^~~~~
main.c:11:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   11 | static class Program{
      |                     ^
main.c:48:1: error: unknown type name 'public'
   48 | public class Sc{
      | ^~~~~~
main.c:48:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Sc'
   48 | public class Sc{
      |              ^~