#CCBCHBON0000020. Bỏ giá trị không hợp lệ khi tính tổng (Skip Invalid Scores)

Bỏ giá trị không hợp lệ khi tính tổng (Skip Invalid Scores)

Skip Invalid Scores

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

Sum only scores within the inclusive interval [0,10][0,10] among nn integers. Ignore values below 0 or above 10. Both endpoints are valid; print 0 if no value qualifies.

Input

Read nn (0≤n≤1000000\le n\le100000), then exactly nn integer scores in [−100,100][-100,100].

Output

Print the sum of valid scores.

Subtasks

  • Subtask 1 (20%): 0≤n≤80\le n\le 8; −100≤ai≤100-100\le a_i\le100.

  • Subtask 2 (30%): 0≤n≤10000\le n\le 1000; −100≤ai≤100-100\le a_i\le100.

  • Subtask 3 (50%): 0≤n≤1000000\le n\le 100000; −100≤ai≤100-100\le a_i\le100.

Examples

Example 1

Input:

5
-2 0 10 11 3

Output:

13

Explanation:

Only values in [0,10] are valid: [0, 10, 3]. Their sum is 13.

Example 2

Input:

3
-1 11 100

Output:

0

Explanation:

Only values in [0,10] are valid: []. Their sum is 0.