human
Danny, the local Math Maniac, is fascinated by circles, Omkar's most recent creation. Help him solve this circle problem!

You are given n nonnegative integers a_1, a_2, ..., a_n arranged in a circle, where n must be odd (ie. n-1 is divisible by 2). Formally, for all i such that 2 ≤ i ≤ n, the elements a_{i - 1} and a_i are considered to be adjacent, and a_n and a_1 are also considered to be adjacent. In one operation, you pick a number on the circle, replace it with the sum of the two elements adjacent to it, and then delete the two adjacent elements from the circle. This is repeated until only one number remains in the circle, which we call the circular value.

Help Danny find the maximum possible circular value after some sequences of operations. 

Input

The first line contains one odd integer n (1 ≤ n < 2 ⋅ 10^5, n is odd) — the initial size of the circle.

The second line contains n integers a_{1},a_{2},...,a_{n} (0 ≤ a_{i} ≤ 10^9) — the initial numbers in the circle.

Output

Output the maximum possible circular value after applying some sequence of operations to the given circle.

Examples

Input

3
7 10 2

Output

17

Input

1
4

Output

4

Note

For the first test case, here's how a circular value of 17 is obtained:

Pick the number at index 3. The sum of adjacent elements equals 17. Delete 7 and 10 from the circle and replace 2 with 17.

Note that the answer may not fit in a 32-bit integer.
Using python3 can you solve the prior task?
 Can you provide a Python program to find the maximum possible circular value after some sequences of operations?
assistant
#Here is Python program to find the maximum possible circular value after some sequences of operations.

import os
import heapq
import sys
import math
import bisect
import operator
from collections import defaultdict
from io import BytesIO, IOBase

def prime_factors(n):  #to calculate set of prime factors
    i = 2
    factors = set()
    while i * i <= n:
        if n % i:
            i += 1
        else:
            factors.add(n // i)
            n = n // i
            factors.add(i)

    if n > 1:
        factors.add(n)
    return factors

def isPrime(n):  # <-----------check whether a no. is prime or not
    if n == 2 or n == 3: return True
    if n % 2 == 0 or n < 2: return False
    for i in range(3, int(n ** 0.5) + 1, 2):  # only odd numbers
        if n % i == 0:
            return False

    return True
# def gcd(a,b):
#     if b==0:

#         return a
#     else:
#         return gcd(b,a%b)Aa
def inar():
    return [int(k) for k in input().split()]
def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b)
def lcmm(a,b):
    return (a*b)//gcd(a,b)
def main():
    # mod=10**9+7
    #for _ in range(int(input())):
    n=int(input())
    arr=inar()
    if n==1:
        print(arr[0])
    else:
        prefix=[arr[0],arr[1]]
        for i in range(2,n):
            prefix.append(prefix[i-2]+arr[i])
        suffix=[0]*n
        for i in range(n-1,-1,-1):
            if (i+2)>n-1:
                suffix[i]=arr[i]
            else:
                suffix[i]=arr[i]+suffix[i+2]
        ans=0
        # print(prefix)
        # print(suffix)
        #print(arr)
        for i in range(n):
            if (i-1)==-1:
                ans=max(ans,suffix[i]+0)
            else:
                ans = max(ans, suffix[i] + prefix[i - 1])
        print(ans)












BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b =...