import strutils, sequtils let N = stdin.readLine.parseInt V = stdin.readLine.split.map parseInt var dp = newSeq[int](N) block main: dp[0] = V[0] if N == 1: break dp[1] = max(V[0], V[1]) if N == 2: break for i in 2 ..< N: dp[i] = max(dp[i - 1], dp[i - 2] + V[i]) echo dp.max