n = int(input()) a = list(map(int, input().split())) if n % 2 == 0: print(sum(a)) else: k = (n + 1) // 2 print(sum(a[:k]))