#CCBCHBAHAI0000180. Số bị thiếu (Missing Number)

Số bị thiếu (Missing Number)

Missing Number

Source: CSES

Version: Phuoc Hung OJ Extended

Problem

You are given an integer nn. Exactly one number from 1,2,…,n1,2,\ldots,n is missing. The input contains the other n−1n-1 pairwise distinct numbers.

Find the missing number.

For Chapter 32, the primary solution uses a presence array: mark every value that appears, then find the unmarked value.

Input

  • The first line contains nn.
  • The second line contains n−1n-1 pairwise distinct integers from [1,n][1,n].

Output

Print the unique missing number.

Subtasks

Subtask 1 (20 points): 2≤n≤202\le n\le 20; the given n−1n-1 numbers are pairwise distinct and lie in [1,n][1,n].

Subtask 2 (30 points): 2≤n≤20002\le n\le 2000; the given n−1n-1 numbers are pairwise distinct and lie in [1,n][1,n].

Subtask 3 (50 points): 2≤n≤2000002\le n\le 200000; the given n−1n-1 numbers are pairwise distinct and lie in [1,n][1,n].

Example

Input

5
2 3 1 5

Output

4

Explanation

Among {1,2,3,4,5}, only 4 is absent.