SDE Path

The Missing Number

Easy

The Missing Number

Find the one value missing from 0..N using a sum formula.

Input format

The first line has N. The second line has N distinct integers, all from the range 0..N with exactly one value missing.

Output format

Print the one number from 0..N that is missing from the array.

Constraints

  • Values fit in a 64-bit signed integer
  • Trailing whitespace and a trailing newline are ignored by the judge

Read from stdin, write to stdout. Sample cases below show the exact format.

Sample cases

Example 1
Input
3
0 1 3
Expected output
2
Example 2
Input
1
0
Expected output
1