CORRUPTION AWAY
Stepan Ivanovich, a mid-level official, has decided to combat corruption by refusing some of his unearned income. Previously, each visitor would leave a monetary reward (bribe) for him to resolve certain issues. Now, Stepan Ivanovich has made a firm decision not to accept two consecutive bribes. Although this results in less money, it is less conspicuous to the security service.
Given the number of visitors N and the array X[1..N] representing the size of the bribes in the order they are received, determine the maximum sum Stepan Ivanovich can collect under these new conditions.
Input
The first line contains an integer N – the number of visitors (1 ≤ N ≤ 1000). The second line contains N natural numbers, representing the sizes of the bribes in the order they are received, with each value not exceeding 1000000.
Output
Output the maximum sum of bribes Stepan Ivanovich can collect.