#CCBCHBAHAI0000087. Tìm số bị thiếu trong 0..n bằng seen[]

    ID: 1005 Loại: Thông thường 2000ms 256MiB Tried: 0 Đã chấp nhận: 0 Độ khó: 1 Đăng bởi: Nhãn>Programming language basicsStatic arraysIteration techniquesImplementation techniquesWorking with numbersInteger arithmetic

Tìm số bị thiếu trong 0..n bằng seen[]

Find the Missing Number in 0..n Using seen[]

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem

You are given nn distinct integers a0,a1,…,an−1a_0,a_1,\ldots,a_{n-1} chosen from

U={0,1,…,n}.U=\{0,1,\ldots,n\}.

Exactly one value m∈Um\in U is missing. Find that value using presence marking.

Input

The first line contains nn. The second line contains nn distinct integers with 0≤ai≤n0\le a_i\le n.

Output

Print the unique missing integer mm.

Subtask

Subtask 1 (20 points): 1≤n≤101\le n\le10.

Subtask 2 (30 points): 1≤n≤50001\le n\le5000.

Subtask 3 (50 points): 1≤n≤2⋅1051\le n\le2\cdot10^5.

Example

Input

5
3 0 1 5 2

Output

4

Explanation

The result follows directly from the mathematical definition above.