#CCBCHHAI0000024. Hai điểm liên tiếp hợp lệ (Two Accepted Scores in a Stream)

Hai điểm liên tiếp hợp lệ (Two Accepted Scores in a Stream)

Two Accepted Scores in a Stream

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

Read a stream of integer scores. A score is accepted when it belongs to the closed interval [0,10][0,10]. Ignore rejected scores, take the first two accepted scores, and print their sum. The two accepted scores need not be adjacent in the original stream.

Input

A whitespace-separated sequence of integers in [−10,20][-10,20], containing at least two accepted scores. The last integer is the second accepted score.

Output

Print the integer sum of exactly the first two accepted scores on one line.

Subtasks

  • Subtask 1 (20%): At most 55 values in [−10,20][-10,20].
  • Subtask 2 (30%): At most 100100 values in [−10,20][-10,20].
  • Subtask 3 (50%): At most 100000100000 values in [−10,20][-10,20].

Examples

Example 1

Input

-1 8 12 7

Output

15

Explanation

Reject -1, accept 8, reject 12, accept 7. Their sum is 15.

Example 2

Input

0 10

Output

10

Explanation

Both boundary scores 0 and 10 are accepted; their sum is 10.