Polycarpus adores TV series. Right now he is ready to finish watching a season of a popular sitcom "Graph Theory". In total, the season has n episodes, numbered with integers from 1 to n.

Polycarpus watches episodes not one by one but in a random order. He has already watched all the episodes except for one. Which episode has Polycaprus forgotten to watch?


-----Input-----

The first line of the input contains integer n (2 ≤ n ≤ 100000) — the number of episodes in a season. Assume that the episodes are numbered by integers from 1 to n.

The second line contains n - 1 integer a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ n) — the numbers of episodes that Polycarpus has watched. All values of a_{i} are distinct.


-----Output-----

Print the number of the episode that Polycarpus hasn't watched.


-----Examples-----
Input
10
3 8 10 1 7 9 6 5 2

Output
4

Difficulty: EASY
Tags: Implementation

Starter code:

Solutions:
n = int(input())
a = list(map(int, input().split()))
a.sort()
m = len(a)
flag = 1
for i in range(1, m + 1):
	if i != a[i - 1]:
		print(i)
		flag = 0
		break
if flag == 1:
	print(n)


n = int(input())
a = list(map(int, input().split()))
s = n * (n + 1) // 2
sa = sum(a)
print(s - sa)


n = int(input())
a = sorted([int(i) for i in input().split()])
k = n
for i in range(n - 1):
	if a[i] != i + 1:
		k = i + 1
		break
print(k)


n = int(input())
l = list(map(int, input().split()))
l.sort()
for i in range(1, n + 1):
	if i == n:
		print(n)
		break
	if l[i - 1] != i:
		print(i)
		break


n = int(input())
a = []
for i in range(n + 1):
	a.append(0)
b = [int(i) for i in input().split()]
for i in range(n - 1):
	a[b[i]] = 1
for i in range(1, n + 1):
	if a[i] == 0:
		print(i)
		break


i = input
n = int(i())
print((n * n + n) // 2 - sum(map(int, i().split())))


def selection_sort(l):
	for i in range(len(l)):
		min_val = l[i]
		min_val_index = i
		for j in range(i, len(l)):
			if l[j] < min_val:
				min_val = l[j]
				min_val_index = j
		(l[i], l[min_val_index]) = (l[min_val_index], l[i])
	return l

def main_function():
	n = input()
	l = sorted([int(i) for i in input().split(' ')])
	for i in range(len(l)):
		if not i == l[i] - 1:
			return l[i] - 1
	return l[len(l) - 1] + 1
print(main_function())


import sys
from collections import defaultdict
from heapq import nlargest
Input = lambda : map(int, input().split())
n = int(input())
a = list(Input())
res = [-1] * n
for i in range(n - 1):
	res[a[i] - 1] = 1
for i in range(n):
	if res[i] == -1:
		print(i + 1)


n = int(input())
ai = list(map(int, input().split()))
print(n * (n + 1) // 2 - sum(ai))


n = int(input())
ser = {i for i in range(1, 1 + n)}
smotr = set(map(int, input().split()))
for i in ser:
	if i not in smotr:
		print(i)
		break


n = int(input())
lst1 = [int(i) for i in input().split()]
lst2 = [int(i) for i in range(1, n + 1)]
lst1.sort()
for i in range(0, n):
	if i < n - 1 and lst2[i] != lst1[i]:
		print(lst2[i])
		break
	elif i == n - 1:
		print(lst2[i])


num = int(input(''))
lst = input('')
lst = [int(numeric_string) for numeric_string in lst.split(' ')]
lst.sort()
for i in range(num):
	if i == num - 1 or lst[i] != i + 1:
		print(i + 1)
		break


n = int(input())
l = list(map(int, input().split()))
l = set(l)
l1 = [i for i in range(1, n + 1)]
l1 = set(l1)
l1 = l1 - l
l1 = list(l1)
l1 = [str(i) for i in l1]
print(' '.join(l1))


a = int(input())
l = list(map(int, input().split()))
l.sort()
for j in range(a - 1):
	if l[j] != j + 1:
		print(j + 1)
		break
	elif j == a - 2:
		print(a)


n = int(input())
a = list(map(int, input().split()))
print(n * (n + 1) // 2 - sum(a))


n = int(input())
watched = list(map(int, input().split()))
total = sum(list(range(1, n + 1)))
for i in watched:
	total -= i
print(total)


n = int(input())
s = set(map(int, input().split()))
for i in range(1, n + 1):
	if not i in s:
		print(i)
		break


n = int(input())
arr = map(int, input().split())
ans = n * (n + 1) // 2 - sum(arr)
print(ans)


n = int(input())
s = set([int(i) for i in input().split()])
t = set(range(1, n + 1))
a = list(t - s)
print(a[0])


n = int(input())
a = list(range(1, n + 1))
s = list(map(int, input().split()))
a = set(a)
s = set(s)
p = a.difference(s)
p = list(p)
print(p[0])


n = int(input())
e = list(map(int, input().split(' ')))
s = n * ((n + 1) / 2)
total = sum(e)
print(int(s - total))


missed = [i + 1 for i in range(int(input()))]
for i in map(int, input().split()):
	missed[i - 1] = 0
print(sum(missed))


n = int(input())
l = list(map(int, input().split()))
o = n * (n + 1) // 2
s = sum(l)
print(o - s)


n = int(input())
a = [int(i) for i in input().split()]
n = n * (n + 1) // 2
for i in a:
	n -= i
print(n)


epi = int(input())
watched = input().split()
e1 = ['0'] * epi
for i in watched:
	j = int(i)
	e1[j - 1] = i
v = 0
while v < len(e1):
	if '0' == e1[v]:
		print(v + 1)
	v += 1


print(next(iter(set(range(1, int(input()) + 1)) - set(map(int, str.split(input()))))))


n = int(input())
x = list(map(int, input().split()))
x = sorted(x)
xx = []
for i in range(1, n + 1):
	xx.append(i)
print(sum(xx) - sum(x))


n = int(input())
a = set(input().split())
b = set()
for i in range(1, n + 1):
	b.add(str(i))
for i in b.difference(a):
	print(i)


n = int(input())
a = list(map(int, input().split()))
a.sort()
for x in range(len(a)):
	if a[x] != a[-1] and a[x] + 1 != a[x + 1]:
		print(a[x] + 1)
		break
else:
	if a[0] != 1:
		print(1)
	else:
		print(n)


n = int(input())
a = set(map(int, input().split()))
print(list(set(range(1, n + 1)) - a)[0])


n = int(input())
s = [int(v) for v in input().split()]
t = sum(range(1, n + 1))
for i in s:
	t -= i
print(t)


import sys

def main():
	(n, *l) = map(int, sys.stdin.read().strip().split())
	return n * (1 + n) // 2 - sum(l)
print(main())


n = int(input())
s = set((int(i) for i in input().split()))
ss = set((int(i) for i in range(1, n + 1)))
k = list(ss.difference(s))
print(k[0])


n = int(input())
b = [int(b) for b in input().split()]
l = []
for i in range(1, n + 1):
	l.append(i)
print(*set(l) ^ set(b))


print((set(range(1, int(input()) + 1)) - set(map(int, input().split()))).pop())


n = int(input())
s = sum(map(int, input().split()))
print(n * (n + 1) // 2 - s)


n = int(input())
x = [int(x) for x in input().split()]
print(int(n * (n + 1) / 2 - sum(x)))


number = int(input(''))
myDict = {}
arr = input('').split(' ')
for x in arr:
	t = int(x)
	myDict[t] = 1
cur = 1
lastNum = True
for x in sorted(myDict):
	if x != cur:
		print(cur)
		lastNum = False
		break
	cur += 1
if lastNum:
	print(number)


n = int(input())
c = set(map(int, input().split()))
for x in range(1, n + 1):
	if x not in c:
		print(x)


X = int(input())
print(X * (X + 1) // 2 - sum(list(map(int, input().split()))))


(f, n, l) = (0, int(input()), sorted(map(int, input().split())))
for x in range(n - 1):
	if l[x] != x + 1:
		print(x + 1)
		f = 1
		break
if f == 0:
	print(n)


n = int(input())
s = sum([int(i) for i in input().split()])
print(n * (n + 1) // 2 - s)


n = int(input())
s = list(map(int, input().split()))
l = list(range(1, n + 1))
l = set(l)
s = set(s)
r = l.difference(s)
r = list(r)
print(r[0])


n = int(input())
a = sorted(list(map(int, input().split())))
if a[-1] != n:
	print(n)
else:
	for i in range(len(a)):
		if a[i] != i + 1:
			print(i + 1)
			break


n = int(input())
a = [int(i) for i in input().split()]
k = 0
for i in range(1, n + 1):
	k = k ^ i
for i in range(n - 1):
	k = k ^ a[i]
print(k)


season = int(input())
episodes = input().split()
episodes = list(map(int, episodes))
episodes.sort()
sm = sum(range(season + 1))
for i in episodes:
	sm = sm - i
print(sm)


n = int(input())
print((n * n + n) // 2 - sum(list(map(int, input().split()))))


from collections import Counter
n = int(input())
c = Counter([int(i) for i in input().split()])
for i in range(1, n + 1):
	if c[i] == 0:
		print(i)


n = int(input())
e = list(map(int, input().split()))
print(int(n * (n + 1) / 2) - sum(e))


n = int(input())
ser = {x for x in range(1, n + 1)}
serw = {int(x) for x in input().split()}
print(list(ser - serw)[0])


n = int(input())
d = n * (n + 1) // 2
a = list(map(int, input().split()))
s = 0
for i in range(0, n - 1):
	s += a[i]
print(int(d - s))


reg = int(input())
list = []
re = input().split()
for i in range(0, reg - 1):
	list.append(int(re[i]))
lis = sorted(list)
if lis[0] == 2:
	print(1)
elif lis[len(lis) - 1] == reg - 1:
	print(reg)
else:
	for j in range(0, len(lis) - 1):
		if lis[j + 1] - lis[j] == 2:
			print((lis[j + 1] + lis[j]) // 2)
			break


n = int(input())
A = list(map(int, input().split()))
A.sort()
A.append(0)
B = []
for i in range(1, n + 1):
	B.append(i)
for j in range(n):
	if A[j] != B[j]:
		print(B[j])
		break


import sys
input = sys.stdin.buffer.readline
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
z = 0
for i in range(0, n - 1):
	if arr[i] == i + 1:
		continue
	else:
		print(i + 1)
		z = 1
		break
if z == 0:
	print(n)


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
from types import CodeType, new_class
n = int(input())
d = [0] * (n + 1)
for x in input().split():
	d[int(x)] = 1
print(d[1:].index(0) + 1)


n = int(input())
array = map(int, input().split())
print(n * (n + 1) // 2 - sum(array))


n = int(input())
p = input().split()
l = []
i = 0
while i < n - 1:
	l.append(int(p[i]))
	i = i + 1
l.sort()
i = 0
while i < n - 1:
	if i + 1 != l[i]:
		break
	i = i + 1
print(i + 1)


n = int(input())
print(n * (n + 1) // 2 - sum(sorted(list(map(int, input().split())))))


n = int(input())
l = list(map(int, input().split()))
l.sort()
aa = []
for i in range(n):
	aa.append(i + 1)
flag = 0
for i in range(n):
	if i < len(l) and aa[i] != l[i]:
		print(aa[i])
		flag = 1
		break
if flag == 0:
	print(n)


n = int(input())
l = list(map(int, input().split()))
ris = 0
for e in l:
	ris += e
print(int(n * (n + 1) / 2 - ris))


n = int(input())
l = list(map(int, input().split()))
l.sort()
count = 0
for i in range(len(l)):
	if l[i] != i + 1:
		print(i + 1)
		count += 1
		break
if count == 0:
	print(n)


n = int(input())
a = list(map(int, input().split()))
ans = n * (n + 1) // 2
for elem in a:
	ans -= elem
print(ans)


n = int(input())
set_ = set(map(int, input().split()))
for i in range(1, n + 1):
	if i not in set_:
		print(i)
		exit()


n = int(input())
a = list(map(int, input().split()))
temp = [0] * (n + 1)
for i in range(n - 1):
	temp[a[i]] += 1
for i in range(1, n + 1):
	if temp[i] == 0:
		print(i)
		break


total_episodes = int(input())
watched_episodes = list(map(int, input().split()))
total_sum = total_episodes * (total_episodes + 1) // 2
watched_sum = sum(watched_episodes)
print(total_sum - watched_sum)


n = int(input())
a = list(map(int, input().split()))
a.sort()
k = 1
for i in range(n - 1):
	if a[i] > k:
		print(k)
		break
	k += 1
if k == n:
	print(n)


import sys
import math
import itertools
import collections

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ''.join(map(str, arr))

def revn(n):
	return int(str(n)[::-1])

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base=3):
	newnumber = ''
	while number > 0:
		newnumber = str(number % base) + newnumber
		number //= base
	return newnumber
n = ii()
a = sorted(li())
a.append(10 ** 5 + 1)
for i in range(n):
	if i + 1 != a[i]:
		exit(print(i + 1))


n = int(input())
s = sum(list(map(int, input().split())))
k = 0
for i in range(1, n + 1):
	k = k + i
print(k - s)


n = int(input())
L = list(map(int, input().split()))
Taken = [False] * n
for item in L:
	Taken[item - 1] = True
for i in range(n):
	if not Taken[i]:
		print(i + 1)
		break


n = int(input())
total = n * (n + 1) / 2
eps = list(map(int, input().split()))
actual = sum(eps)
print(int(abs(total - actual)))


n = int(input())
series = set(map(int, input().split()))
print(*set(range(1, n + 1)) - series)


n = int(input())
m = map(int, input().split()[:n])
m = sorted(m)
k = 0
for i in range(n - 2):
	if m[i] + 1 != m[i + 1]:
		print(m[i] + 1)
		break
	else:
		k += 1
if m[0] != 1:
	print(1)
elif k == n - 2:
	print(n)


n = int(input())
a = list(map(int, input().split()))
b = set(range(1, n + 1)).difference(a)
print(*b)


n = int(input())
a = set(map(int, input().split()))
for i in range(1, n + 1):
	if i not in a:
		print(i)


garbage = int(input())
z = list(map(int, input().rstrip().split(' ')))
res = [0] * (garbage + 1)
res[0] = 1
for i in z:
	res[i] = 1
print(res.index(0))


n = int(input())
l = sorted(list(map(int, input().split())))
for i in range(1, n + 1):
	if len(l) == 0 or i != l[0]:
		print(i)
		break
	else:
		l.remove(i)


n = int(input())
movie = list(map(int, input().strip().split()))
movie.sort()
for i in range(1, n + 1):
	if i in movie:
		movie.remove(i)
	else:
		print(i)
		break


n = int(input())
l = list(map(int, input().split()))
x = [0 for i in range(n)]
for i in l:
	x[i - 1] += 1
print(x.index(0) + 1)


n = int(input())
watched = [False] * n
for i in map(int, input().split()):
	watched[i - 1] = True
for i in range(n):
	if not watched[i]:
		print(i + 1)
		break


n = int(input())
a = list(map(int, input().split()))
flg = 0
a.sort()
for i in range(n - 1):
	if a[i] != i + 1:
		print(i + 1)
		flg = 1
		break
if flg == 0:
	print(n)


a = int(input())
a = a * (a + 1) / 2
b = input().split()
for i in b:
	a = a - int(i)
print(int(a))


n = int(input())
episodes = list(map(int, input().split()))[:n]
episodes.sort()
episodes.append(0)
for i in range(1, n + 1):
	if i != episodes[i - 1]:
		print(i)
		break


def solution(n, b):
	i = 1
	b.sort()
	while i < n:
		if i != b[i - 1]:
			return i
		i += 1
	return n

def answer():
	n = int(input())
	b = [int(x) for x in input().split()]
	print(solution(n, b))
answer()


import bisect
n = int(input())
a = sorted(list(map(int, input().split())))
ans = n
for i in range(1, len(a) + 1):
	if i != a[i - 1]:
		ans = i
		break
print(ans)


n = int(input())
a = list(map(int, input().split()))
a.sort()
t = 1
for i in a:
	if i != t:
		print(t)
		exit()
	else:
		t += 1
print(n)


n = int(input())
l = list(map(int, input().split()))
t = n * (n + 1) // 2
print(t - sum(l))


n = int(input())
towatch = set([i for i in range(1, n + 1)])
watched = [int(i) for i in input().split()]
for i in watched:
	towatch.remove(i)
print(towatch.pop())


n = int(input())
l = list(map(int, input().split()))
a = n * (n + 1) // 2
b = a - sum(l)
print(b)


def main():
	n = int(input())
	episodes = [0] + [int(_) for _ in input().split()]
	episodes.sort()
	try:
		index = next((i for i in range(n) if i != episodes[i]))
	except StopIteration:
		index = n
	print(index)
main()


n = int(input())
li = list(map(int, input().split()))
su = n * (n + 1) // 2
print(su - sum(li))


n = int(input())
a = [int(i) for i in input().split()]
t = 0
for i in range(n - 1):
	t += a[i]
print(n * (n + 1) // 2 - t)


T_ON = 0
DEBUG_ON = 0
MOD = 998244353

def solve():
	n = read_int()
	A = read_ints()
	print(n * (n + 1) // 2 - sum(A))

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def is_even(x):
	return x % 2 == 0

def is_odd(x):
	return x % 2 == 1

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P
main()


x = int(input())
l = list(map(int, input().split()))
p = [i for i in range(1, x + 1)]
l = l + p
c = l[0]
for i in range(1, len(l)):
	c = c ^ l[i]
print(c)


TN = 1

def solution():
	n = int(input())
	a = list(map(int, input().split()))
	ans = [0 for i in range(n)]
	for i in a:
		ans[i - 1] = 1
	print(ans.index(0) + 1)
while TN != 0:
	solution()
	TN -= 1


n = int(input())
l = list(map(int, input().split()))
s = set(l)
l2 = []
for i in range(1, n + 1):
	l2.append(i)
s2 = set(l2)
print(*s2 - s)


n = int(input())
a = sorted(map(int, input().split())) + [0]
for x in range(1, n + 1):
	if x - a[x - 1] != 0:
		print(x)
		break


n = int(input())
watched = list(map(int, input().split()))
watched.sort()
for i in range(len(watched)):
	if watched[i] != i + 1:
		print(i + 1)
		break
	if watched[i] == len(watched):
		print(len(watched) + 1)


n = int(input())
a = sorted(list(map(int, input().split())))
for i in range(1, n + 1):
	if i == n:
		print(n)
		exit()
	if i != a[i - 1]:
		print(i)
		exit()


import itertools
import time

def timer(f):

	def tmp(*args, **kwargs):
		t = time.time()
		res = f(*args, **kwargs)
		print('Время выполнения функции: %f' % (time.time() - t))
		return res
	return tmp
n = int(input())
array = list(map(int, input().split(' ')))
series = [0 for i in range(n + 1)]
for i in range(0, len(array)):
	series[array[i]] += 1
for i in range(1, len(series)):
	if series[i] == 0:
		print(i)
		exit(0)


n = int(input())
p = input().split()
res = dict()
for (idx, ele) in enumerate(p):
	res[ele] = idx
for i in range(1, n + 1):
	if str(i) not in res:
		print(i)


n = int(input())
sum_a = sum(map(int, input().split()))
print(n * (n + 1) // 2 - sum_a)


n = int(input())
x = list(map(int, input().split()))
a = n * [0]
for i in range(n):
	a[i] = i + 1
print(*set(a) ^ set(x))


from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

def read_int():
	return int(stdin.readline())

def read_ints():
	return [int(x) for x in stdin.readline().split()]

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]
total = range(1, int(input()) + 1)
seen = read_ints()
print(*set(total) - set(seen))


N = int(input())
X = sorted(list(map(int, input().split())))
if X[0] != 1 or X[-1] != N:
	print(1 if X[0] != 1 else N)
	exit()
for i in range(1, N):
	if X[i] - X[i - 1] != 1:
		print(X[i] - 1)
		exit()


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x) + '\n')
n = get_int()
lst = set(get_int_list())
for i in range(1, n + 1):
	if i not in lst:
		print(i)
		break


n = int(input())
array = input().split(' ')
nar = []
for i in range(len(array)):
	nar.append(int(array[i]))
nar.sort()
for i in range(n - 2):
	if nar[i + 1] - nar[i] > 1:
		print(i + 2)
		exit()
if nar[0] == 2:
	print(1)
	exit()
print(n)


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	l = LI()
	l.sort()
	for i in range(1, n):
		if i != l[i - 1]:
			return i
	return n
print(main())


ep = int(input(''))
arr = []
arr2 = []
sum1 = 0
if ep >= 2:
	x = str(input(''))
	arr = x.split()
	for j in range(0, ep - 1):
		z = arr[j]
		arr2.append(int(z))
	for i in range(0, ep - 1):
		sum1 = sum1 + arr2[i]
	org = ep * (ep + 1) / 2
	print(int(org - sum1))


n = int(input())
l = sorted([int(i) for i in input().split()])
if l[0] == 2:
	print(1)
elif l[n - 2] != n:
	print(n)
else:
	for i in range(1, n - 1):
		if l[i] - l[i - 1] == 2:
			c = l[i - 1] + 1
			break
	print(c)


n = int(input())
array1 = list(map(int, input().split()))
array1.sort()
sample1 = range(1, n + 1)
z = list(sample1)
set1 = set(array1)
set2 = set(z)
final = set2 - set1
print(*final)


n = int(input())
a = [int(i) for i in input().split()]
p = n * [0]
for i in range(n - 1):
	p[a[i] - 1] = 1
print(p.index(0) + 1)


n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(1, n + 1):
	b.append(0)
for i in a:
	b[i - 1] = 1
print(b.index(0) + 1)


n = int(input())
nums = [int(j) for j in input().split()]
ref = n * [0]
for j in range(n - 1):
	ref[nums[j] - 1] = 1
for j in range(n):
	if ref[j] == 0:
		print(j + 1)
		break


n = int(input())
episodes = set((int(x) for x in input().split()))
for i in range(1, n + 1):
	if i not in episodes:
		print(i)
		break


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import Counter
import heapq
from collections import Counter
from bisect import bisect_right
import bisect
n = int(input())
arr = list(map(int, input().split()))
d = Counter(arr)
for i in range(1, n + 1):
	if i not in d:
		print(i)


n = int(input())
arr = map(int, input().split())
sum1 = n * (n + 1) // 2
sum2 = sum(arr)
print(sum1 - sum2)


n = int(input())
l = set(map(int, input().split()))
k = set(range(1, n + 1))
k1 = k - l
print(*k1)


n = int(input())
a = [int(x) for x in input().split()]
used = [0] * n
for x in a:
	used[x - 1] = 1
print(used.index(0) + 1)


a = int(input())
b = sorted(list(map(int, input().split())))
c = list(range(1, a + 1))
b = set(b)
c = set(c)
f = c.difference(b)
f = list(f)
print(f[0])


n = int(input())
l = set([int(x) for x in input().split()])
g = []
for i in range(1, n + 1):
	g.append(i)
g = set(g)
print(*set.difference(g, l))


n = int(input())
num = list(map(int, input().split()))
tot1 = 0
tot2 = 0
for i in range(n):
	tot1 += i + 1
for i in range(n - 1):
	tot2 += num[i]
miss = tot1 - tot2
print(miss)


n = int(input())
s = list(map(int, input().split()))
p = n * (n + 1) // 2
q = sum(s)
a = p - q
print(a)


n = int(input())
a = list(map(int, input().split()))
s = 0
while n > 0:
	s = s + n
	n = n - 1
print(s - sum(a))


n = int(input())
f = 0
d = n * (n + 1) // 2
sum = 0
a = [int(i) for i in input().split()]
for i in range(0, len(a)):
	sum = sum + a[i]
f = d - sum
print(f)


n = int(input())
l = list(map(int, input().split()))
temp = [i for i in range(1, n + 1)]
print(sum(temp) - sum(l))


def missing(n, lst):
	return sum(range(1, n + 1)) - sum(lst)
N = int(input())
a = [int(i) for i in input().split()]
print(missing(N, a))


n = int(input())
arr = list(map(int, input().split()))
print(int(n * (n + 1) / 2) - sum(arr))


n = int(input())
series = list(map(int, input().split()))
smotrel = [False] * 100000
for i in series:
	smotrel[i - 1] = True
for i in range(n):
	if not smotrel[i]:
		break
print(i + 1)


n = int(input())
a = input().split()
s = n * (n + 1) // 2
for i in range(n - 1):
	s -= int(a[i])
print(s)


n = int(input())
epis = set(map(int, input().split()))
series = set((int(i) for i in range(1, n + 1)))
missed_epis = series.difference(epis)
out = ''.join((str(i) for i in missed_epis))
print(out)


P = int(input())
X = [0] * P
S = list(map(int, input().split()))
for s in S:
	X[s - 1] = 1
print(X.index(0) + 1)


n = int(input())
l = list(map(int, input().split()))
print(sum(range(1, n + 1)) - sum(l))


n = int(input())
set_ = set(map(int, input().split()))
print(n * (n + 1) // 2 - sum(set_))


print(((2 * int(input()) + 1) ** 2 - 1) // 8 - sum(map(int, input().split())))


n = int(input())
n1 = list(map(int, input().split()))
n1.sort()
s = 0
k = 0
for i in n1:
	s = s + 1
	if s != i:
		print(s)
		k = k + 1
		break
if k == 0:
	print(s + 1)


n = int(input())
l = list(map(int, input().split()))
l.sort()
p = [j for j in range(1, max(l) + 1)]
o = 0
flag = 0
for k in p:
	if k == l[o]:
		o += 1
		continue
	else:
		print(k)
		flag = 1
		break
if flag == 0:
	print(n)


n = int(input())
l = list(map(int, input().split()))
l.sort()
flag = 0
for i in range(1, n):
	if i == l[i - 1]:
		continue
	else:
		flag = 1
		print(i)
		break
if flag == 0:
	print(n)


def read(mode=2):
	inputs = input().strip()
	if mode == 0:
		return inputs
	if mode == 1:
		return inputs.split()
	if mode == 2:
		return [int(x) for x in inputs.split()]

def write(s='\n'):
	if isinstance(s, list):
		s = ' '.join(s)
	s = str(s)
	print(s, end='')
(n,) = read()
a = read()
write(n * (n + 1) // 2 - sum(a))


n = int(input())
a = sorted(list(map(int, input().split())))
k = sum(a)
l = 0
for i in range(n + 1):
	l += i
print(l - k)