#CCBCHBON0000017. Bỏ qua giá trị âm trước khi cộng (Skip Negatives Before Summing)

Bỏ qua giá trị âm trước khi cộng (Skip Negatives Before Summing)

Skip Negatives Before Summing

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

Compute the sum of only nonnegative entries (ai≥0a_i\ge0) among nn integers. Zero is valid. Print 0 for an empty sequence or when all entries are negative.

Input

First nn (0≤n≤1000000\le n\le100000), followed by exactly nn integers in [−106,106][-10^6,10^6].

Output

Print the sum as a signed 64-bit integer.

Subtasks

  • Subtask 1 (20%): 0≤n≤80\le n\le 8; −106≤ai≤106-10^6\le a_i\le10^6.

  • Subtask 2 (30%): 0≤n≤10000\le n\le 1000; −106≤ai≤106-10^6\le a_i\le10^6.

  • Subtask 3 (50%): 0≤n≤1000000\le n\le 100000; −106≤ai≤106-10^6\le a_i\le10^6.

Examples

Example 1

Input:

4
-3 0 8 -2

Output:

8

Explanation:

Keep nonnegative values [0, 8]; their sum is 8.

Example 2

Input:

3
-4 -2 -1

Output:

0

Explanation:

Keep nonnegative values []; their sum is 0.