102041: [AtCoder]ABC204 B - Nuts

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:1 Solved:0

Description

Score : $200$ points

Problem Statement

There are $N$ trees. The $i$-th tree bears $A_i$ nuts.

Chipmunk will harvest nuts from the trees in the following manner:

  • From a tree with $10$ or fewer nuts, she does not take nuts.
  • From a tree with more than $10$ nuts, she takes all but $10$ nuts.

Find the total number of nuts Chipmunk will take from the trees.

Constraints

  • $1 \leq N \leq 1000$
  • $0 \leq A_i \leq 1000$
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

$N$
$A_1$ $\ldots$ $A_N$

Output

Print the answer.


Sample Input 1

3
6 17 28

Sample Output 1

25

From the three trees, Chipmunk will take $0$, $7$, and $18$ nuts, for a total of $25$ nuts.


Sample Input 2

4
8 9 10 11

Sample Output 2

1

Input

题意翻译

输入 $n$ 个非负整数,记第 $i$ 个非负整数为 $a_i$ 。有一个变量 $m$ ,其初始值为 $0$ 。对于每个 $a_i$ ,如果 $a_i≤10$ , $m$ 不做变化;否则将 $m$ 加上 $a_i-10$ 的值。请在输入所有 $a_i$ 后输出 $m$ 的值。

加入题单

上一题 下一题 算法标签: