Messy Kevin IV


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C++, Java, Python

Kevin from the IT team has not been doing a very good job. He'd messed up syncing the server logs, he'd messed up analysing the log messages, and he couldn't index the files in the servers either. He'd messed it up every single time! If he is always struggling to complete his tasks, then is it worth keeping him around?

Your boss decided to give him one last chance. Kevin's job was now on the line.

Kevin's task was to find the missing integer in a list of integers from 1 to n inclusive. He had to do this in O(n) time complexity and with O(1) space complexity. Even if he got the solution, if he didn't follow these rules, he wouldn't be deemed fit for the job.

Your boss has also given you this task, and tells you that he'll give you a raise if you solve it before Kevin does. You've been cleaning up Kevin's mess every time, and it's time you got rewarded for it!

Input

The first line contains an integer n (2 \leq n \leq 10^5), the maximum value of an integer in the list.

The next line contains n-1 unique integers, with values ranging between 1 and n inclusive. This means that there is one integer missing in this list.

Output

Output the missing integer in the list.

Example

Input 1
4
3 2 4
Output 1
1

The missing number in the list of integers between 1 and 4 inclusive is 1.

Input 2
8
3 7 6 8 1 4 2
Output 2
5

Comments

There are no comments at the moment.