On another rainy day two friends are stuck indoors, so they invent a game.
On a sheet of paper they draw n fields. Each field carries two numbers: its index (a distinct integer from 1 to n) and its value (an integer between −1000 and 1000). A pawn starts on field 1. On every move the player rolls a six-sided die (its faces are numbered 1 through 6) and advances the pawn forward by the number rolled. The game ends the instant the pawn lands on field n. The player's score is the sum of the values of every field the pawn stood on, counting both the starting field 1 and the final field n.
Because the players may pick any rolls they like, one game corresponds to a sequence of forward steps, each between 1 and 6 fields, that starts on field 1 and stops exactly on field n. Compute the largest score achievable over all such sequences.
The first line contains an integer n (1≤n≤106), the number of fields. The second line contains n integers w1,w2,…,wn (−1000≤wi≤1000), where wi is the value of field i.
Print one integer: the maximum score that can be obtained on the given board.