B - MissingNo. Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点 : 200

問題文

ナオヒロ君は N+1 個の連続する整数を 1 個ずつ持っていましたが、そのうち 1 個をなくしてしまいました。

残っている N 個の整数が順不同で A_1,\ldots,A_N として与えられるので、なくした整数を求めてください。

なお、なくした整数が一意に定まるような入力のみが与えられます。

制約

  • 2 \leq N \leq 100
  • 1 \leq A_i \leq 1000
  • 入力は全て整数である
  • なくした整数は一意に定まる

入力

入力は以下の形式で標準入力から与えられる。

N
A_1 A_2 \ldots A_N

出力

答えを出力せよ。


入力例 1

3
2 3 5

出力例 1

4

ナオヒロ君は初め 2,3,4,54 個の整数を持っており、4 をなくし、2,3,5 が残っていました。

なくした整数である 4 を出力します。


入力例 2

8
3 1 4 5 9 2 6 8

出力例 2

7

入力例 3

16
152 153 154 147 148 149 158 159 160 155 156 157 144 145 146 150

出力例 3

151

Score : 200 points

Problem Statement

Naohiro had N+1 consecutive integers, one of each, but he lost one of them.

The remaining N integers are given in arbitrary order as A_1,\ldots,A_N. Find the lost integer.

The given input guarantees that the lost integer is uniquely determined.

Constraints

  • 2 \leq N \leq 100
  • 1 \leq A_i \leq 1000
  • All input values are integers.
  • The lost integer is uniquely determined.

Input

The input is given from Standard Input in the following format:

N
A_1 A_2 \ldots A_N

Output

Print the answer.


Sample Input 1

3
2 3 5

Sample Output 1

4

Naohiro originally had four integers, 2,3,4,5, then lost 4, and now has 2,3,5.

Print the lost integer, 4.


Sample Input 2

8
3 1 4 5 9 2 6 8

Sample Output 2

7

Sample Input 3

16
152 153 154 147 148 149 158 159 160 155 156 157 144 145 146 150

Sample Output 3

151