#C4515. Calculate Team Submission Points

    ID: 48062 Type: Default 1000ms 256MiB

Calculate Team Submission Points

Calculate Team Submission Points

You are given a team submission record for a contest. The contest scores each correct submission with a certain number of points. Initially, the first correct submission is worth 100 points. Every time a team makes a correct submission, they earn the current points and the value for the next correct submission is decreased by 10 (i.e. 100, 90, 80, ...). Incorrect submissions do not alter the current point value and do not add any points.

Your task is to compute the total points scored by the team based on a sequence of submissions. Each submission is represented by an integer: 1 for a correct answer and 0 for an incorrect answer.

The scoring stops decrementing only when a correct submission occurs; if a submission is incorrect, the current point value remains unchanged for the next submissions.

Note: The input is provided via standard input (stdin) and the result should be printed to standard output (stdout).

Example:

Input:
5
1 0 1 1 0

Output:
270

Explanation: The first correct submission gives 100 points, then the second correct submission gives 90 and the third gives 80 (total = 100+90+80 = 270).

inputFormat

The first line of input contains a single integer n representing the number of submissions.

The second line contains n space-separated integers. Each integer is either 0 (incorrect submission) or 1 (correct submission).

outputFormat

Output a single integer, the total points scored by the team.

## sample
5
1 0 1 1 0
270