import collections N = int(input()) lsA = list(map(int,input().split())) lssumf = [lsA[0]-lsA[1]] lssumr = [lsA[2*N-1]-lsA[2*N-2]] for i in range(2,2*N,2): lssumf.append(lssumf[-1]+lsA[i]-lsA[i+1]) for i in range(2*N-3,-1,-2): lssumr.append(lssumr[-1]+lsA[i]-lsA[i-1]) lssumr.reverse() ans = max(lssumr[0],lssumf[N-1]) for i in range(N-1): ans = max(ans,lssumf[i]+lssumr[i+1]) print(ans)