Dr. Evil kidnapped Mahmoud and Ehab in the evil land because of their performance in the Evil Olympiad in Informatics (EOI). He decided to give them some problems to let them go.

Dr. Evil is interested in sets, He has a set of n integers. Dr. Evil calls a set of integers evil if the MEX of it is exactly x. the MEX of a set of integers is the minimum non-negative integer that doesn't exist in it. For example, the MEX of the set {0, 2, 4} is 1 and the MEX of the set {1, 2, 3} is 0 .

Dr. Evil is going to make his set evil. To do this he can perform some operations. During each operation he can add some non-negative integer to his set or erase some element from it. What is the minimal number of operations Dr. Evil has to perform to make his set evil?


-----Input-----

The first line contains two integers n and x (1 ≤ n ≤ 100, 0 ≤ x ≤ 100) — the size of the set Dr. Evil owns, and the desired MEX.

The second line contains n distinct non-negative integers not exceeding 100 that represent the set.


-----Output-----

The only line should contain one integer — the minimal number of operations Dr. Evil should perform.


-----Examples-----
Input
5 3
0 4 5 6 7

Output
2

Input
1 0
0

Output
1

Input
5 0
1 2 3 4 5

Output
0



-----Note-----

For the first test case Dr. Evil should add 1 and 2 to the set performing 2 operations.

For the second test case Dr. Evil should erase 0 from the set. After that, the set becomes empty, so the MEX of it is 0.

In the third test case the set is already evil.

Source: codeforces | Difficulty: EASY
Tags: Implementation

Greedy algorithms


Solutions:
(n, x) = map(int, input().split())
a = list(map(int, input().split()))
t = 0
a.sort()
for i in range(x):
	if not i in a:
		t += 1
if x in a:
	t += 1
print(t)


def main():
	(n, x) = [int(i) for i in input().split()]
	H = set([int(i) for i in input().split()])
	changes = 0
	for i in range(x):
		if i not in H:
			changes += 1
	if x in H:
		changes += 1
	print(changes)
main()


(n, x) = input().split()
n = int(n)
x = int(x)
counter = 0
list = input().split()
list = [int(x) for x in list]
if x in list:
	list.remove(x)
	counter += 1
for i in range(0, x):
	if i >= x:
		break
	elif i in list:
		y = 10
	else:
		list.append(i)
		counter += 1
print(counter)


(n, x) = map(int, input().split())
s = set(map(int, input().split()))
print(x + sum(((i == x) - (i < x) for i in s)))


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
step = 0
if x in a:
	a.remove(x)
	step += 1
for i in range(x):
	if not i in a:
		step += 1
print(step)


f = lambda : map(int, input().split())
(n, k) = f()
c = 0
l = list(f())
for i in range(k):
	if not i in l:
		c += 1
if k in l:
	c += 1
print(c)


(n, x) = map(int, input().split())
a = set(map(int, input().split()))
if x in a:
	b = set((i for i in range(0, x)))
	print(1 + len(b) - len(a.intersection(b)))
else:
	b = set((i for i in range(0, x)))
	print(len(b) - len(a.intersection(b)))


(nums, intS) = map(int, input().split())
list1 = list(map(int, input().split()))
dictA = {}
result = intS
for i in list1:
	if i < intS and dictA.get(i, 0) == 0:
		result -= 1
	dictA[i] = dictA.get(i, 0) + 1
print(result + dictA.get(intS, 0))


(n, k) = map(int, input().split())
l = [int(i) for i in input().split()]
l.sort()
cnt = 0
for i in range(0, k):
	if i not in l:
		cnt += 1
if k in l:
	cnt += 1
print(cnt)


(a, b) = input().split(' ')
a = int(a)
b = int(b)
c = input().split(' ')
c = sorted(list(map(int, c)))
m2 = [c[i] for i in range(len(c)) if c[i] <= b]
m1 = [i for i in range(b) if not i in m2]
if b in c:
	m1.append(b)
print(len(m1))


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


(n, k) = map(int, input().split())
lst = list(map(int, input().split()))
cnt = [0] * 101
for i in lst:
	cnt[i] += 1
rs = cnt[k]
for i in range(k):
	if cnt[i] == 0:
		rs += 1
print(rs)


(n, x) = map(int, input().split())
s = list(map(int, input().split()))
s.sort()
i = 0
while i < n and s[i] < x:
	i += 1
if i < n and s[i] == x or (i - 1 >= 0 and s[i - 1] == x):
	print(x - i + 1)
else:
	print(x - i)


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


(n, x) = list(map(int, input().split(' ')))
vs = list(map(int, input().split(' ')))
print(sum((1 for i in range(x) if i not in vs)) + (1 if x in vs else 0))


(x, y) = map(int, input().split())
lista = list(map(int, input().split()))
if y in lista:
	cont = 1
else:
	cont = 0
lista.sort()
for c in range(0, 101):
	if y > c and c not in lista:
		cont += 1
	elif y < c:
		break
print(cont)


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


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
con = 0
for i in range(k):
	if i not in l:
		con += 1
if k not in l:
	print(con)
else:
	print(con + l.count(k))


(n, x) = map(int, input().split())
s = list(map(int, input().split()))
s = sorted(s)
i = 0
while i < n and s[i] < x:
	i += 1
res = x - i
if i < n and s[i] == x:
	res += 1
print(res)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
c = 0
k = 0
while k < x:
	if k not in a:
		c += 1
	k += 1
if x in a:
	c += 1
print(c)


def getNumber(x, ls):
	count = 0
	for l in ls:
		if l < x:
			count += 1
	return count
(num, x) = map(eval, input().strip().split(' '))
ls = list(map(eval, input().strip().split(' ')))
ls.sort()
if x in ls:
	print(x - getNumber(x, ls) + 1)
elif x < ls[0]:
	print(x)
elif x > ls[len(ls) - 1]:
	print(x - num)
else:
	print(x - getNumber(x, ls))


(g, x) = [int(i) for i in input().split()]
n = [int(i) for i in input().split()]
h = [False] * 101
for i in n:
	h[i] = True
Q = False
p = 0
i = 0
while Q == False:
	if x > i and h[i] == False:
		p += 1
	elif x == i:
		if h[i] == True:
			p += 1
			Q = True
		else:
			Q = True
	i += 1
print(p)


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


(n, x) = map(int, input().split())
ar = list(map(int, input().split()))
ans = x
if x in ar:
	ans += 1
for i in ar:
	if i < x:
		ans -= 1
print(ans)


(n, x) = map(int, input().split())
l = list(map(int, input().split()))
t = x
z = 0
for i in l:
	if i < x:
		t -= 1
	if i == x:
		t += 1
print(t)


(num, x) = map(eval, input().strip().split(' '))
ls = list(map(eval, input().strip().split(' ')))
ls.sort()
count = 0
for l in ls:
	if l >= x:
		break
	count += 1
if x in ls:
	print(x - count + 1)
else:
	print(x - count)


(n, x) = map(int, input().split())
lst = [int(x) for x in input().split()]
lst.sort()
cnt = 0
for i in range(x):
	if not i in lst:
		cnt += 1
if x in lst:
	cnt += 1
print(cnt)


maxn = 100
(n, x) = map(int, input().split())
s = list(map(int, input().split()))
a = [0 for i in range(maxn + 1)]
for item in s:
	a[item] = 1
num = 0
for i in range(x):
	if a[i] == 0:
		num += 1
if a[x] == 1:
	num += 1
print(num)


def yeah(a, b):
	h = 0
	for i in range(b):
		if str(i) not in a:
			h += 1
	return h
(c, b) = map(int, input().split())
a = list(input().strip().split(' '))
x = yeah(a, b)
if str(b) in a:
	x = x + 1
print(x)


(n, x) = map(int, input().split())
l = [1] * 101
for v in map(int, input().split()):
	l[v] = 0
ans = int(not l[x])
for i in range(x):
	ans += l[i]
print(ans)


def mex(array):
	mex = 100
	for i in range(101):
		if array.count(i) == 0 and i < mex:
			mex = i
	return mex
array = input().split()
n = int(array[0])
x = int(array[1])
array = input().split()
for i in range(len(array)):
	array[i] = int(array[i])
m = mex(array)
count = 0
if m > x:
	array.pop(array.index(x))
	count += 1
if m < x:
	for i in range(m, x):
		if array.count(i) == 0:
			array.append(i)
			count += 1
if array.count(x) != 0:
	array.remove(x)
	count += 1
print(count)


def u_b(li, x, low, high):
	while low <= high:
		mid = (high + low) // 2
		if li[mid] < x:
			low = mid + 1
		else:
			high = mid - 1
	return low
(n, x) = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
index = u_b(l, x, 0, n - 1)
print(x - index if x not in l else x - index + 1)


def check(n, list, m):
	if n in list:
		list.remove(n)
		m += 1
	if len(list) == 0:
		return n + m
	elif n < list[0]:
		if n == 0:
			return m
		else:
			return n + m
	elif list[0] < n < list[-1]:
		count = 0
		for i in list:
			if n > i:
				count += 1
		return n - count + m
	elif n > list[-1]:
		return n - len(list) + m
while True:
	try:
		(a, n) = map(int, input().strip().split())
		list = [i for i in map(int, input().strip().split())]
		list.sort()
		m = 0
		print(check(n, list, m))
	except:
		break


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
arr.sort()
count = 0
if k != 0:
	for i in range(0, k):
		if i not in arr:
			count += 1
	if k in arr:
		count += 1
	print(count)
elif k in arr:
	print(1)
else:
	print(0)


(n, x) = input().split()
(n, x) = (int(n), int(x))
e_set = input().split()
e_set = [int(k) for k in e_set]
res = x
for k in e_set:
	if k < x:
		res -= 1
	if k == x:
		res += 1
print(res)


(n, x) = map(int, input().split())
l0 = [int(i) for i in input().split()]
l0.sort()
assert len(l0) == n
count = 0
while x in l0:
	l0.remove(x)
	count += 1
	for i in range(x):
		if i not in l0:
			count += 1
			l0.append(i)
			l0.sort()
if x not in l0:
	for i in range(x):
		if i not in l0:
			count += 1
			l0.append(i)
			l0.sort()
print(count)


(a, b) = map(int, input().split())
d = 0
A = input().split()
if A.count(str(b)) > 0:
	d += 1
for i in range(0, b):
	if A.count(str(b - 1)) == 0:
		d += 1
	b -= 1
print(d)


import math
(n, x) = list(map(int, input().split()))
A = list(map(int, input().split()))
mex = 0
A_s = [-1] * 101
for i in A:
	A_s[i] = i
mex = 101
for i in range(len(A_s)):
	if A_s[i] == -1:
		mex = i
		break
if mex == x:
	print(0)
elif mex > x:
	print(1)
elif mex < x:
	cnt = 0
	for i in range(mex, x):
		if A_s[i] == -1:
			cnt = cnt + 1
	if A_s[x] != -1:
		cnt = cnt + 1
	print(cnt)


(n, x) = [int(x) for x in input().split()]
a = list(set(map(int, input().strip().split())))[:n]
ans = 0
if x == 0 and x in a:
	print('1')
else:
	for i in range(n):
		if a[i] < x:
			ans += 1
	if x in a:
		ans -= 1
	print(x - ans)


(n, m) = map(int, input().split())
s = set([int(i) for i in input().split()])
ans = 0
for i in range(m):
	if i not in s:
		ans += 1
print(ans + 1 if m in s else ans)


r = lambda : list(map(int, input().split()))
[n, x] = r()
L = r()
print(len(set([i for i in range(x)]) - set(L)) + L.count(x))


import sys
(_, mex) = [int(x) for x in sys.stdin.readline().split()]
numbers = [int(x) for x in sys.stdin.readline().split()]
frequencies = [0] * 101
for number in numbers:
	frequencies[number] += 1
operations = 0
for i in range(mex):
	if frequencies[i] == 0:
		operations += 1
if frequencies[mex] > 0:
	operations += 1
print(operations)


from sys import maxsize, stdout, stdin, stderr
mod = int(1000000000.0 + 7)

def tup():
	return map(int, stdin.readline().split())

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

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

def S():
	return input().strip()

def grid(r, c):
	return [lint() for i in range(r)]

def debug(*args, c=6):
	print('\x1b[3{}m'.format(c), *args, '\x1b[0m', file=stderr)
from math import log2, sqrt
from collections import Counter, defaultdict
from itertools import permutations
import re

def bark():
	(n, x) = tup()
	ls = lint()
	cnt = 0
	for i in range(x):
		if i in ls:
			pass
		else:
			cnt += 1
	if x in ls:
		cnt += 1
	print(cnt)
bark()


k = lambda : map(int, input().split())
(_, x) = k()
print(x + sum(((i == x) - (i < x) for i in k())))


(n, rm) = map(int, input().strip().split(' '))
a = list(map(int, input().strip().split(' ')))
ans = 0
for i in range(rm):
	if a.__contains__(i) == False:
		ans += 1
if a.__contains__(rm):
	ans += 1
print(ans)


(a, b) = map(int, input().split())
c = list(map(int, input().split()))
ans = 0
for i in range(b):
	if i not in c:
		ans += 1
if b in c:
	ans += 1
print(ans)


(s, n) = map(int, input().split())
set = [int(i) for i in input().split()]
a = list(range(n))
acts = 0
if n in set:
	set.remove(n)
	acts += 1
for i in a:
	if i in set:
		continue
	if i not in set:
		acts += 1
		set.append(i)
		set = sorted(set)
print(acts)


(n, x) = map(int, input().split())
a = [i for i in map(int, input().split()) if i <= x]
print(x - len(a) + (0, 2)[x in a])


(n, x) = list(map(int, input().split()))
l = list(map(int, input().split()))
t = 0
for i in range(0, x + 1):
	if i in l and i == x:
		print(t + 1)
		break
	elif i == x and i not in l:
		print(t)
		break
	elif i in l:
		pass
	else:
		t += 1
else:
	print(t)


(n, x) = map(int, input().split())
l = [-1] + sorted(map(int, input().split()))
count = 0
for i in range(1, len(l)):
	if l[i] > x:
		print(count + x - l[i - 1] - 1)
		break
	count += l[i] - l[i - 1] - 1
	if l[i] == x:
		print(count + 1)
		break
else:
	print(count + x - l[-1] - 1)


(n, k) = [int(x) for x in input().split()]
lst = [int(x) for x in input().split()]
c = 0
for i in range(k):
	if i not in lst:
		c += 1
if k in lst:
	c += 1
print(c)


a = input()
b = input()
a = a.split(' ')
b = b.split(' ')
mex = 0
if a[1] in b:
	mex += 1
for i in range(0, int(a[1])):
	if str(i) not in b:
		mex += 1
print(mex)


p = input()
(n, x) = p.split()
string = list(map(int, input().split()))
x = int(x)
count = 0
a = 0
for j in range(len(string)):
	if string[j] < x:
		count = count + 1
	elif string[j] == x:
		a = 1
ans = x - count + a
print(ans)


def mr_evil():
	target = list(map(int, input().split()))
	array = list(map(int, input().split()))
	output = 0
	if target[1] == 0:
		if 0 in array:
			return 1
		return 0
	if target[1] in array:
		output += 1
	target[1] -= 1
	while True:
		if target[1] not in array:
			output += 1
		target[1] -= 1
		if target[1] == -1:
			break
	return output
A = mr_evil()
print(A)


n = list(map(int, input().split()))
a = list(map(int, input().split()))
k = 0
z = 0
if n[1] in a:
	k += 1
for i in range(n[1]):
	if z < n[1] and z not in a:
		z += 1
		k += 1
	else:
		z += 1
print(k)


(n, x) = map(int, input().split())
n_number = map(int, input().split())
n_set = set(list(n_number))
small = 0
for i in n_set:
	if i < x:
		small += 1
small_count = x - small
if x in n_set:
	count = small_count + 1
else:
	count = small_count
print(count)


R = lambda : list(map(int, input().split()))
(n, x) = R()
a = R()
print(x - len([i for i in a if i < x]) + (1 if x in a else 0))


str1 = input()
(num1, num2) = (int(str1.split(' ')[0]), int(str1.split(' ')[1]))
array_arg = input().split(' ')
count = 0
small = 0
for a in array_arg:
	if int(a) == num2:
		count += 1
		continue
	elif int(a) < num2:
		small += 1
		continue
print(num2 - small + count)
exit(0)


(n, x) = map(int, input().split())
data = list(map(int, input().split()))
k = 0
for i in range(x):
	if i not in data:
		k += 1
if x in data:
	k += 1
print(k)


def main():
	[n, x] = [int(_) for _ in input().split()]
	numbers = [int(_) for _ in input().split()]
	if x in numbers:
		n_actions = 1
	else:
		numbers += [x]
		n_actions = 0
	numbers.sort()
	index = numbers.index(x)
	n_actions += x - index
	print(n_actions)
main()


R = lambda : map(int, input().split(' '))
(n, x) = R()
a = list(R())
o = 1 if x in a else 0
for i in range(x):
	if i not in a:
		o += 1
print(o)


import sys
str1 = sys.stdin.readline()
(num1, num2) = (int(str1.split(' ')[0]), int(str1.split(' ')[1]))
str2 = sys.stdin.readline()
lst = []
for i in range(num1):
	lst.append(int(str2.split(' ')[i]))
result = 0
dic = {}
flag = False
for i in range(num1):
	if lst[i] > num2:
		continue
	if lst[i] == num2:
		flag = True
	if lst[i] not in dic:
		dic[lst[i]] = 1
	else:
		dic[lst[i]] += 1
for j in range(num2):
	if j not in dic.keys():
		result += 1
if flag:
	print(result + dic[num2])
else:
	print(result)


(n, x) = map(int, input().split())
ip = list(map(int, input().split()))
count = 0
for i in range(x):
	if i not in ip:
		ip.append(i)
		count += 1
	else:
		continue
if x not in ip:
	print(count)
else:
	print(count + 1)


def mex(lst, x):
	(a, result) = ([0] * 1000, 0)
	for i in range(len(lst)):
		a[lst[i]] = True
	for i in range(x):
		if not a[i]:
			result += 1
	if a[x] is True:
		result += 1
	return result
(n, X) = [int(i) for i in input().split()]
a = [int(j) for j in input().split()]
print(mex(a, X))


(n, x) = map(int, input().split())
s = [0] * 101
for i in input().split():
	s[int(i)] += 1
count = 0
for i in range(x):
	if not s[i]:
		count += 1
if s[x]:
	count += 1
print(count)


(n, x) = map(int, input().split())
l = (int(x) for x in input().split())
h = [0] * 101
count = 0
for i in l:
	h[i] += 1
for i in range(x):
	if h[i] == 0:
		count += 1
if h[x] == 1:
	count += 1
print(count)


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
count1 = 0
for i in range(m):
	if i not in l:
		count1 += 1
if m not in l:
	print(count1)
else:
	print(count1 + 1)


import sys

def main():
	(n, x) = [int(x) for x in sys.stdin.readline().rsplit()]
	evilSet = set()
	for num in [int(x) for x in sys.stdin.readline().rsplit()]:
		evilSet.add(num)
	evilSet = list(evilSet)
	evilSet.sort()
	xInd = 0
	while evilSet[xInd] < x:
		xInd = xInd + 1
		if xInd >= len(evilSet):
			xInd = len(evilSet)
			break
	retVal = x - len(evilSet[:xInd])
	if len(evilSet) > xInd:
		if evilSet[xInd] == x:
			retVal += 1
	return retVal
print(main())


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
j = 0
t = 0
for i in range(x):
	if j >= len(a):
		break
	elif i == a[j]:
		j += 1
	elif i < a[j]:
		t += 1
if j >= len(a):
	t = x - j
elif a[j] == x:
	t += 1
print(t)


n = list(map(int, input().split()))
nums = set(map(int, input().split()))
mex = n[1]
count = 0
for i in range(mex):
	if i not in nums:
		count += 1
if mex in nums:
	count += 1
print(count)


(n, x) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
r = 0
if x in a:
	a.remove(x)
	r += 1
t = 0
for i in range(x):
	if i not in a:
		a.append(i)
		r += 1
print(r)


def fun(n, x, arr):
	res = arr.count(x)
	arr = list(set([m for m in arr if m < x]))
	resArr = [0 for i in range(x)]
	for i in range(len(arr)):
		resArr[arr[i]] = 1
	res = res + resArr.count(0)
	return res
(n, x) = list(map(int, input().split(' ')))
arr = list(map(int, input().split(' ')))
print(fun(n, x, arr))


(n, x) = map(int, input().split())
a = map(int, input().split())
a = set(a)
k1 = [1 if each < x else 0 for each in a]
k1 = sum(k1)
k2 = x in a
print(x - k1 + int(k2))


(N, X) = map(int, input().split())
A = set(map(int, input().split()))
out = X - sum((1 for n in A if n < X))
if X in A:
	out += 1
print(out)


nx_str = input()
list_str = input()
nx_data = list(map(int, nx_str.split()))
list_data = list(map(int, list_str.split()))
x = nx_data[1]
n = nx_data[0]
num = 0
for i in range(n):
	if list_data[i] < x:
		num = num + 1
if x in list_data:
	result_num = x - num + 1
else:
	result_num = x - num
print(result_num)


from math import gcd, ceil
from collections import defaultdict as dd

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

def inin():
	return int(input())

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

def ar(element, size):
	return [element for i in range(size)]

def digitsum(num):
	su = 0
	while num:
		su += num % 10
		num //= 10
	return su
(n, x) = inar()
arr = inar()
cnt = 0
for i in range(x):
	if i not in arr:
		cnt += 1
cnt += arr.count(x)
print(cnt)


def main():
	(n, x) = list(map(int, input().split()))
	s = set(map(int, input().split()))
	res = 0
	for i in range(x):
		if i not in s:
			res += 1
	if x in s:
		res += 1
	print(res)

def __starting_point():
	main()
__starting_point()


(n, mex) = map(int, input().split())
arr = [int(raw) for raw in input().split()]
appear = [0 for i in range(101)]
for a in arr:
	appear[a] += 1
answer = 0
for i in range(0, mex):
	if appear[i] == 0:
		answer += 1
answer += appear[mex]
print(answer)


mex = int(input().split(' ')[1])
numbers = [int(x) for x in input().split(' ')]
numbers.sort()
count = 0
for i in range(mex):
	if i not in numbers:
		count += 1
if mex in numbers:
	count += 1
print(count)


import math
import collections
import bisect
import heapq
import time
import random
(n, x) = map(int, input().split())
e = [0] * 101
for v in [int(x) for x in input().split()]:
	e[v] = 1
ans = 0
for i in range(x):
	ans += e[i] == 0
ans += e[x] == 1
print(ans)


(n, x) = list(map(int, input().split()))
t = list(map(int, input().split()))
p = 0
if x in t:
	p += 1
for k in range(x):
	if k not in t:
		p += 1
print(p)


(n, k) = map(int, input().split())
arr = [int(i) for i in input().split()]
ans = 0
if k == 0:
	if k in arr:
		print('1')
	else:
		print('0')
else:
	for i in range(k):
		if i not in arr:
			ans += 1
	if k in arr:
		ans += 1
	print(ans)


(n, x) = map(int, input().split())
arr = sorted([int(x) for x in input().split()])
ans = x
for i in range(n):
	if arr[i] < x:
		ans -= 1
	if arr[i] == x:
		ans += 1
print(ans)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
c = 0
for i in range(max(a[-1], x)):
	if i not in a and i < x:
		c += 1
if x in a:
	c += 1
print(c)


def count_evil_operations(x, testList):
	operation_counter = 0
	if x in testList:
		operation_counter += 1
	else:
		testList.append(x)
	testList = sorted(testList)
	indexOfMEX = testList.index(x)
	if len(testList[0:indexOfMEX]) == x:
		return operation_counter
	else:
		operation_counter += x - len(testList[0:indexOfMEX])
		return operation_counter
nx = input()
mas = input()
(n, x) = [int(s) for s in nx.split(' ') if s.isdigit()]
evil = [int(s) for s in mas.split(' ') if s.isdigit()]
print(count_evil_operations(x, evil))


(n, x) = list(map(int, input().split()))
a = list(map(int, input().split()))
b = sum((i < x for i in a))
print(x - b + (x in a))


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
L = list(range(105))
for i in range(n):
	L[a[i]] += 1
for i in range(m):
	if L[i] == i:
		ans += 1
if L[m] != m:
	ans += 1
print(ans)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
p = 0
for i in range(x):
	if i not in a:
		p += 1
if x in a:
	print(p + 1)
else:
	print(p)


a = input().split()
n = int(a[0])
x = int(a[1])
s = list(map(int, input().split()))
s.sort()
count = 0
if x in s:
	for i in range(0, x):
		if i not in s:
			count = count + 1
	print(count + 1)
else:
	for i in range(0, x):
		if i not in s:
			count += 1
	print(count)


import sys
str1 = sys.stdin.readline()
(num1, num2) = (int(str1.split(' ')[0]), int(str1.split(' ')[1]))
str2 = sys.stdin.readline()
lst = []
for i in range(num1):
	lst.append(int(str2.split(' ')[i]))
result = 0
com = list(range(num2))
for i in range(num2):
	if i not in lst:
		result += 1
for i in range(num1):
	if lst[i] > num2:
		continue
	if lst[i] == num2:
		result += 1
print(result)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
b = list(range(x + 1))
count = 0
for i in b:
	if i not in a and i != x:
		count += 1
	if i in a and i == x:
		count += 1
print(count)


(n, x) = map(int, input().split())
l = list(map(int, input().split()))
a = []
for i in range(102):
	a.append(0)
for i in l:
	a[i] = a[i] + 1
mis = 0
pre = a[x]
for i in range(x):
	mis = mis + (a[i] == 0)
print(mis + pre)


(n, x) = map(int, input().split())
l = list(map(int, input().split(' ')))
nl = [i for i in range(0, max(max(l) + 2, x)) if not i in l]
if x in nl:
	d = len([i for i in nl if i < x])
elif max(l) + 2 > x:
	d = len([i for i in nl if i < x]) + 1
else:
	d = len(nl)
print(d)


import sys
nx = sys.stdin.readline()
(n, x) = (int(i) for i in nx.strip().split(' '))
s = sys.stdin.readline()
s = set((int(i) for i in s.strip().split(' ')))
a = 0
for i in range(0, x):
	if i not in s:
		a += 1
if x in s:
	a += 1
print(a)


def mex(s):
	for x in range(102):
		if x not in s:
			return x

class CodeforcesTask862ASolution:

	def __init__(self):
		self.result = ''
		self.n_x = []
		self.set = []

	def read_input(self):
		self.n_x = [int(x) for x in input().split(' ')]
		self.set = [int(x) for x in input().split(' ')]

	def process_task(self):
		operations = 0
		while mex(self.set) != self.n_x[1]:
			operations += 1
			if mex(self.set) > self.n_x[1]:
				self.set.remove(self.n_x[1])
			else:
				self.set.append(mex(self.set))
		self.result = str(operations)

	def get_result(self):
		return self.result
Solution = CodeforcesTask862ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


(n, m) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
e = 0
for i in range(0, m):
	if i not in a:
		e = e + 1
if m in a:
	e = e + 1
print(e)


import sys

def Ints():
	return map(int, sys.stdin.readline().strip().split())

def Strs():
	return map(str, sys.stdin.readline().strip().split())

def Array():
	return list(map(int, sys.stdin.readline().strip().split()))

def Str():
	return sys.stdin.readline().strip()

def Int():
	return int(sys.stdin.readline().strip())

def MOD():
	return 1000000007

def power(base, power):
	MOD = 1000000007
	result = 1
	while power > 0:
		if power % 2 == 1:
			result = result * base % MOD
		power = power // 2
		base = base * base % MOD
	return result
(n, x) = Ints()
a = Array()
sa = set(a)
count = 0
for i in range(x):
	if i not in sa:
		count += 1
if x in sa:
	count += 1
print(count)


(n, x) = [int(x) for x in input().split()]
s = set([int(x) for x in input().split()])
cnt = 0
for i in range(x):
	if i not in s:
		cnt = cnt + 1
if x in s:
	cnt = cnt + 1
print(cnt)


(n, x) = map(int, input().strip().split())
l = list(map(int, input().strip().split()))
count = x + 1 if x in l else x
count -= sum((e < x for e in l))
print(count)


(n, x) = list(map(int, input().split()))
M = list(map(int, input().split()))
k = len(range(x))
for i in range(x):
	if i in M:
		k -= 1
if x in M:
	print(k + 1)
else:
	print(k)


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


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
s = [0] * 101
for i in a:
	s[i] = 1
k = 0
for i in range(x):
	if s[i] == 0:
		k += 1
if s[x] != 0:
	k += 1
print(k)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
c = [0] * 101
for ai in a:
	c[ai] = 1
s = x - sum(c[:x]) + c[x]
print(s)


(n, x) = map(int, input().split())
l = set(list(map(int, input().split())))
t = 0
if x == 0:
	if x in l:
		print(1)
		exit()
	else:
		print(0)
		exit()
if x in l:
	t = t + 1
for i in range(x):
	if i in l:
		continue
	else:
		t = t + 1
print(t)


(a, b) = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
ll = 0
s = 0
for i in range(a):
	if l[i] < b:
		ll += 1
	elif l[i] == b:
		s = 1
print(b - ll + s)


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


def readln():
	return list(map(int, input().rstrip().split()))
(n, x) = readln()
data = list(readln())
data.sort()
count = 0
pad = 0
for i in data:
	if i < x:
		count += 1
	if i == x:
		pad = 1
print(x + pad - count)


(a, b) = map(int, input().split())
c = set(map(int, input().split()))
print(len(set(range(b)) - c) + [0, 1][b in c])


(n, x) = map(int, input().split())
s = set(map(int, input().split()))
res = x - len(s.intersection(range(x)))
if x in s:
	res += 1
print(res)


str1 = input()
num1 = int(str1.split(' ')[0])
num2 = int(str1.split(' ')[1])
array_arg = input().split(' ')
array = []
for a in array_arg:
	array.append(int(a))
array.sort()
count = 0
len_before = 0
for b in array:
	if b < num2:
		len_before += 1
if num2 in array:
	count += 1
print(num2 - len_before + count)
exit(0)


(n, x) = map(int, input().split())
l = list(map(int, input().split()))
if x not in l:
	l.append(x)
	l.sort()
	a = l.index(x)
	print(x - a)
else:
	l.sort()
	a = l.index(x)
	print(x - a + 1)


(n, x) = input().split()
n = int(n)
x = int(x)
arr = set(map(int, input().split()))
num = 0
ans = 0
for i in arr:
	if i < x:
		num += 1
		continue
	if i == x:
		ans += 1
print(ans + x - num)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
less = []
more = []
for item in a:
	if item < x:
		less.append(item)
	else:
		more.append(item)
ans = 0
if x in a:
	a.remove(x)
	ans += 1
ans += x - len(less)
print(ans)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
res = x
for i in a:
	if i < x:
		res -= 1
	if i == x:
		res += 1
print(res)


k = lambda : map(int, input().split())
(n, x) = k()
(*a,) = k()
print(x - sum((i < x for i in a)) + (x in a))


(n, x) = map(int, input().split())
q = 0
e = 0
a = []
a1 = []
a = input().split()[:n]
a1 = list(map(int, a))
for i in range(n):
	if a1[i] == x:
		e = e + 1
	if a1[i] < x:
		q = q + 1
w = x - q + e
print(w)


(n, m) = map(int, input().split())
vis = [0] * 105
arr = list(map(int, input().split()))
for i in arr:
	vis[int(i)] = 1
print(vis[:m].count(0) + vis[m])


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
i = 0
a = sorted(a)
while i < n and a[i] < x:
	i += 1
if x in a:
	print(x - i + 1)
else:
	print(x - i)


(n, x) = map(int, input().split())
s = input()
p1 = s.split()
p = []
t = []
for n in p1:
	p.append(int(n))
for i in range(0, x):
	if i not in p:
		t.append(i)
l = 0
for k in range(0, len(t)):
	if t[k] != x:
		l += 1
if x in p:
	l += 1
print(abs(l))


(n, x) = map(int, input().split())
v = list(map(int, input().split()))
m = max(v)
if x == 0:
	if m == 0:
		print(1)
	elif x in v:
		print(1)
	else:
		print(0)
else:
	b = [1] * x
	for i in v:
		if i < x:
			b[i] = 0
		elif i == x:
			b.append(1)
	print(sum(b))


(a, b) = map(int, input().split())
count = 0
liist = list(map(int, input().split()))
if b in liist:
	liist.remove(b)
	count += 1
for i in range(b):
	if i not in liist:
		count += 1
print(count)


(n, x) = list(map(int, input().split()))
m = set(map(int, input().split()))
m1 = [1 if i in m else 0 for i in range(102)]
s = 0
for i in range(x):
	if m1[i] == 0:
		s += 1
if m1[x] == 1:
	s += 1
print(s)


(size, mex) = input().split()
(size, mex) = (int(size), int(mex))
array = list(map(int, input().split()))
count = 0
for item in array:
	if item < mex:
		count += 1
print(mex - count + int(mex in array))


(n, x) = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
l.sort()

def f(x):
	i = 0
	while i in x:
		i += 1
	return i
c = 0
while f(l) != x:
	if f(l) > x:
		c += 1
		break
	for i in range(f(l), x):
		if i not in l:
			c += 1
			l.append(i)
			l.sort()
	if f(l) > x:
		c += 1
	break
print(c)


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


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
c = 0
if x in a:
	a.remove(x)
	c = c + 1
for j in range(0, x):
	if j not in a:
		a.append(j)
		c = c + 1
print(c)


(n, x) = map(int, input().split())
Nums = list(map(int, input().split()))
step = x
for i in Nums:
	if i < x:
		step -= 1
if Nums.count(x) > 0:
	step += 1
print(step)


func = lambda : map(int, input().split())
(n, x) = func()
print(x + sum(((i == x) - (i < x) for i in func())))


from sys import stdin, stdout

def rint():
	return list(map(int, stdin.readline().split()))
(n, x) = rint()
a = list(rint())
a.sort()
b = [0 for i in range(101)]
for aa in a:
	b[aa] = 1
cnt = 0
for i in range(x):
	if b[i] == 0:
		cnt += 1
if b[x] == 1:
	cnt += 1
print(cnt)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
t = 0
count = 0
for i in range(n):
	if a[i] < x:
		count += 1
	if a[i] == x:
		t = t + 1
if t == 0:
	print(x - count)
else:
	print(x - count + 1)


(x, y) = map(int, input().split())
set1 = set(map(int, input().split()))
z = 0
for i in range(y):
	if i not in set1:
		z += 1
if y in set1:
	z += 1
print(z)


(n, x) = list(map(int, input().split()))
set = list(map(int, input().split()))
score = 0
set.sort()
for i in range(x + 1):
	if i != x and i not in set:
		score += 1
	elif i == x and i in set:
		print(score + 1)
		quit()
	elif i == x and i not in set:
		print(score)
		quit()


(n, mex) = input().split()
a = input().split()
k = 0
for i in range(int(mex)):
	if not str(i) in a:
		k += 1
if mex in a:
	k += 1
print(k)


read = lambda : tuple(map(int, input().split()))
(l, x) = read()
v = read()
ans = 0
for i in range(0, 101):
	if i < x and (not i in v) or (i == x and i in v):
		ans += 1
print(ans)


(n, x) = input().split()
i = 0
res = 0
s = []
while i <= 101:
	s.append(0)
	i = i + 1
p = input().split()
for item in p:
	if int(item) >= 0:
		s[int(item)] = 1
for i in range(int(x)):
	if not s[i]:
		res += 1
if s[int(x)] == 1:
	res += 1
print(res)


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
c = 0
for i in l:
	if i < m:
		c = c + 1
if m in l:
	print(abs(m - c) + 1)
else:
	print(abs(m - c))


(n, x) = [int(e) for e in input().split()]
a = set([int(e) for e in input().split()])
mark = [1 if e in a else 0 for e in range(101)]
if mark[x] == 0:
	print(mark[:x].count(0))
else:
	print(mark[:x].count(0) + 1)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
c = 0
if x in a:
	a.remove(x)
	c = c + 1
a.sort()
if len(a) > 0:
	r = min(a)
for j in range(0, x):
	if j not in a:
		a.append(j)
		c = c + 1
a.sort()
print(c)


(n, x) = map(int, input().split())
L = list(map(int, input().split()))
o = 0
if x in L:
	L.remove(x)
	o += 1
for i in range(x):
	if i not in L:
		L.append(i)
		o += 1
print(o)


(n, x) = map(int, input().split())
arr = list(map(int, input().split()))
ans = sum((i < x for i in arr))
ans = x - ans
if x in list(arr):
	ans += 1
print(ans)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
for xx in range(x):
	if xx not in a:
		ans += 1
if x in a:
	ans += 1
print(ans)


(n, x) = map(int, input().split())
list1 = list(map(int, input().split()))
t = 0
for i in range(0, x):
	if i in list1:
		continue
	else:
		t = t + 1
if x in list1:
	t = t + 1
print(t)


(g, x) = [int(i) for i in input().split()]
n = [int(i) for i in input().split()]
h = [False] * 101
for i in n:
	h[i] = True
p = 0
for i in range(x):
	if h[i] == False:
		p += 1
if h[x] == True:
	p += 1
print(p)


(n, k) = [int(i) for i in input().split(' ')]
exists = [0 for i in range(k + 1)]
line = [int(i) for i in input().split(' ')]
for x in line:
	if x <= k:
		exists[x] = 1
op = 0
op += exists[k] == 1
for i in range(k):
	op += exists[i] == 0
print(op)


a = int(input().split()[1])
s = input().split()
d = []
small_list = list(range(a))
small = len(small_list)
same = 0
for i in s:
	d.append(int(i))
d.sort()
for i in d:
	if i == a:
		same += 1
	elif i in small_list:
		small -= 1
		small_list.remove(i)
print(small + same)


from bisect import bisect_left
(n, k) = list(map(int, input().split()))
lst = sorted(list(map(int, input().split())))
count = 0
i = bisect_left(lst, k)
if k in lst:
	count += 1
last = -1
for j in range(i):
	count += lst[j] - last - 1
	last = lst[j]
count += k - last - 1
print(count)


import math
import re

def ria():
	return [int(i) for i in input().split()]
(n, x) = ria()
ar = ria()
mp = {}
for i in range(200):
	mp[i] = 0
for i in ar:
	mp[i] += 1
suma = mp[x]
for i in range(x):
	if mp[i] == 0:
		suma += 1
print(suma)


(n, x) = [int(i) for i in input().split(' ')]
l = [int(i) for i in input().split(' ')]
result = 0
for i in range(x):
	if i not in l:
		result += 1
if x in l:
	result += 1
print(result)


(n, x) = (int(i) for i in input().split())
a = [int(j) for j in input().split()]
a.sort()
counter = 0
for k in a:
	if k >= x:
		break
	counter += 1
clv = x - counter
if k == x:
	clv += 1
print(clv)


(n, x) = list(map(int, input().split(' ')))
a = list(map(int, input().split(' ')))
(count, i) = (0, 0)
while i < x:
	if i not in a:
		count += 1
	i += 1
print(count if x not in a else count + 1)


import sys
str1 = sys.stdin.readline()
(num1, num2) = (int(str1.split(' ')[0]), int(str1.split(' ')[1]))
str2 = sys.stdin.readline()
lst = []
for i in range(num1):
	lst.append(int(str2.split(' ')[i]))
lst.sort()
result = 0
if num2 not in lst:
	for i in range(num2):
		if i not in lst:
			result += 1
	print(result)
elif num2 in lst:
	dic = {}
	for i in range(num1):
		if lst[i] > num2:
			break
		elif lst[i] not in dic:
			dic[lst[i]] = 1
		else:
			dic[lst[i]] += 1
	for j in range(num2):
		if j not in dic.keys():
			result += 1
	print(result + dic[num2])


def get_ints():
	return [int(n) for n in input().split()]

def get_floats():
	return [float(n) for n in input().split()]
a = get_ints()
assert len(a) == 2
(n, x) = (a[0], a[1])
s = get_ints()
assert len(s) == n
count = 1 if x in s else 0
for i in range(x):
	if i not in s:
		count += 1
print('%d' % count)


(n, x) = map(int, input().split())
s = sorted(list(map(int, input().split())))
ans = 0
if x in s:
	ans += 1
for i in range(0, x):
	if i not in s:
		ans += 1
print(ans)


(n, x) = [int(x) for x in input().split()]
d = [int(x) for x in input().split()]
s = set(d)
a = 0
for i in range(x):
	if i not in s:
		a += 1
if x in s:
	a += 1
print(a)


(a, b) = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
j = 0
for i in range(a):
	if x[i] < b:
		j += 1
y = x.count(b)
print(y + b - j)


from bisect import bisect_left as lower_bound
(n, x) = (int(x) for x in input().split())
arr = sorted((int(x) for x in input().split()))
p = lower_bound(arr, x)
print(x - p + (p < len(arr) and arr[p] == x))


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
s = set(l)
ans = 0
if k in s:
	ans += 1
for i in range(k):
	if i not in s:
		ans += 1
print(ans)


(n, x) = (int(i) for i in input().split())
(A, ans) = ([0] * 101, 0)
for a in input().split():
	A[int(a)] = 1
print(x - sum(A[:x]) + A[x])


line = input()
a_b = list(map(int, line.split()))
a = int(a_b[0])
b = int(a_b[1])
num_list = input()
num_list = list(map(int, num_list.split()))
temp = 0
flag = 0
for n in num_list:
	n = int(n)
	if n < b:
		temp += 1
	if n == b:
		flag = 1
print(abs(b - temp + flag))


(n, m) = map(int, input().split())
data = list(map(int, input().split()))
count = 0
for i in range(101):
	if i < m and i not in data:
		count += 1
	if i == m and i in data:
		count += 1
print(count)


(n, x) = input().split()
n = int(n)
x = int(x)
l = input().split()
num = x
for i in range(n):
	if int(l[i]) > x:
		continue
	elif int(l[i]) == x:
		num = num + 1
	else:
		num = num - 1
print(num)


def read():
	return list(map(int, input().split()))
(n, x) = read()
data = read()

def meh(data, op=0):
	data.sort()
	if x not in data:
		d = list(set(list(range(x))).symmetric_difference(data[:x]))
		d = list(filter(lambda y: y < x, d))
		op += len(d)
	if x in data:
		data.pop(data.index(x))
		op += 1
		return meh(data, op)
	else:
		return op
print(meh(data))


(n, x) = map(int, input().split())
array = list(map(int, input().split()))
count = 0
count_array = [0] * 101
for i in array:
	count_array[i] = 1
for i in range(x + 1):
	if i == x:
		if count_array[i] == 1:
			count += 1
	elif count_array[i] == 0:
		count += 1
print(count)


(n, x) = map(int, input().split())
A = set(map(int, input().split()))
cnt = (x in A) + sum((i not in A for i in range(x)))
print(cnt)


(n, x) = map(int, input().split())
num = []
num = [int(n) for n in input().split()]
num.sort()
result = 0
if x < num[0]:
	for i in range(0, x + 1):
		if i < x and i != x:
			result += 1
			continue
	print(result)
else:
	for i in range(0, x + 1):
		if i in num and i != x:
			continue
		elif i not in num and i != x:
			result += 1
		if i in num and i == x:
			result += 1
	print(result)


def ans(X, S):
	ret = S.count(X)
	S = set(S)
	for i in range(0, X):
		if i not in S:
			ret += 1
	return ret
(N, X) = input().split(' ')
N = int(N)
X = int(X)
S = input().split(' ')
S = list(map(int, S))
print(ans(X, S))


def bin_search(data_list, list_len, val):
	low = 0
	high = list_len - 1
	while low <= high:
		mid = (low + high) // 2
		if data_list[mid] == val:
			return (1, mid)
		elif data_list[mid] > val:
			high = mid - 1
		else:
			low = mid + 1
	return (0, low)

def main():
	(n, x) = map(int, input().split())
	num_list = list(map(int, input().split()))
	num_list.sort()
	search_res = bin_search(num_list, n, x)
	ans = x - search_res[1] + search_res[0]
	print(ans)
main()


def main():
	(N, X) = map(int, input().split())
	I = tuple(map(int, input().split()))
	if X in I:
		cnt = 1
	else:
		cnt = 0
	for i in range(X):
		if not i in I:
			cnt += 1
	print(cnt)
main()


(n, x) = map(int, input().split())
list11 = []
list11 = map(int, input().split())
list1 = list(list11)
iterate = 0
list1.sort()
if x in list1:
	list1.remove(x)
	iterate = iterate + 1
	for i in range(0, x):
		if i not in list1:
			list1.append(i)
			iterate = iterate + 1
		else:
			continue
else:
	for i in range(0, x):
		if i not in list1:
			list1.append(i)
			iterate = iterate + 1
		else:
			continue
print(int(iterate))


(n, ev) = list(map(int, input().split()))
number = list(map(int, input().split()))
c = 0
if ev in number:
	c += 1
for i in range(0, ev):
	if i not in number:
		c = c + 1
print(c)


(n, x) = map(int, input().split())
l = set(input().split())
com = 0
for i in range(x + 1):
	k = str(i)
	if i == x:
		if k in l:
			com += 1
	elif k not in l:
		com += 1
print(com)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
mx = max(a)
mn = min(a)
op = 0
if x in a:
	op += 1
if x != 0:
	for i in range(x):
		if i not in a:
			op += 1
print(op)


str_num = input().split(' ')
n = int(str_num[0])
x = int(str_num[1])
str_list = input().split(' ')
tmp = 0
res = 0
for i in range(n):
	int_temp = int(str_list[i])
	if int_temp < x:
		tmp += 1
	elif int_temp == x:
		res = 1
res += x - tmp
print(res)


(n, x) = [int(i) for i in input().split()]
S = [int(i) for i in input().split()]
S = set(S)
nb_move = 0
for i in range(x):
	nb_move += i not in S
nb_move += x in S
print(nb_move)


(n, x) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
ans = 0
for i in range(x):
	if i not in a:
		ans += 1
if x in a:
	ans += 1
print(ans)


(n, x) = map(int, input().split())
s = list(map(int, input().split()))
ma = max(max(s), x)
k = [0 for i in range(ma + 1)]
for i in s:
	k[i] = 1
steps = 0
for i in range(x):
	if k[i] == 0:
		steps = steps + 1
if k[x] == 1:
	print(steps + 1)
else:
	print(steps)


(n, x) = map(int, input().split())
Nums = list(map(int, input().split()))
step = 0
if Nums.count(x) > 0:
	Nums.sort()
	step = x - Nums.index(x) + 1
else:
	Nums.append(x)
	Nums.sort()
	step = x - Nums.index(x)
print(step)


f = [0] * 105
(n, x) = map(int, input().split())
l = [int(x) for x in input().split()]
for ele in l:
	f[ele] = 1
	cnt = 0
	for i in range(x):
		if f[i] == 0:
			cnt += 1
cnt += f[x]
print(cnt)


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

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

def solve(numbers, n, x):
	s = set(numbers)
	num_changes = 0
	for i in range(x):
		if i not in s:
			num_changes += 1
	if x in s:
		num_changes += 1
	return num_changes

def main():
	(n, x) = read_list()
	numbers = read_list()
	print(solve(numbers, n, x))
main()


X = list(map(int, input().split()))
Numbers = sorted(list(map(int, input().split())))
i = 0
while i < len(Numbers) and Numbers[i] < X[1]:
	i += 1
print(X[1] - i if X[1] not in Numbers else X[1] - i + 1)


(n, x) = map(int, input().split())
used = [False for i in range(101)]
arr = list(map(int, input().split()))
for i in arr:
	used[i] = True
cnt = 0
for i in range(101):
	if i == x:
		if not used[i]:
			print(cnt)
			break
		else:
			print(cnt + 1)
			break
	elif not used[i]:
		cnt += 1


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


r = lambda : map(int, input().split())
(n, x) = r()
res = [y for y in r() if y <= x]
print(x - len(res) + 2 * (x in res))


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)
num = 0
if x in a:
	num += 1
for i in range(100):
	if i >= x:
		break
	if i not in a:
		num += 1
print(num)


(n, x) = map(int, input().split())
l = list(map(int, input().split()))
if x == 0:
	if 0 in l:
		print(1)
	else:
		print(0)
else:
	c = 0
	if x in l:
		c = 1
	x = x - 1
	while x != -1:
		if x not in l:
			c += 1
		x -= 1
	print(c)


nums = input().split(' ')
(n, x) = (int(nums[0]), int(nums[1]))
flag = [False for i in range(x)]
count = 0
nums = input().split(' ')
for num_ in nums:
	num = int(num_)
	if num < x:
		flag[num - 1] = True
	elif num == x:
		count += 1
for f in flag:
	if not f:
		count += 1
print(count)


(_, X) = [int(x) for x in input().split()]
s = [int(x) for x in input().split()]
o = len(s)
s = [x for x in s if x >= 0]
acc = o - len(s)
if X in s:
	acc += 1
s = [x for x in s if x < X]
acc += X - len(s)
print(acc)


R = lambda : map(int, input().split())
(n, m) = R()
l = [i for i in sorted(R()) if i <= m]
print([m - len(l), m - len(l) + 2][m in l])


(n, x) = map(int, input().split())
s = input().split()
s = sorted(s)
k = 0
for i in range(x):
	if str(i) not in s:
		k += 1
if str(x) in s:
	k += 1
print(k)


(n, x) = map(int, input().split())
m = [1] * x
xxx = 0
for k in map(int, input().split()):
	if k < x:
		m[k] -= 1
	if k == x:
		xxx += 1
print(xxx + sum([1 for i in range(x) if m[i] == 1]))


def meow():
	(n, x) = [int(i) for i in input().split(' ')]
	arr = [int(i) for i in input().split(' ')]
	s = set(arr)
	moves = 0
	for i in range(x):
		if i not in s:
			s.add(i)
			moves += 1
	if x in s:
		s.remove(x)
		moves += 1
	print(moves)
meow()


(n, x) = input().split()
n = int(n)
x = int(x)
Ar = [int(t) for t in input().split()]
ar = []
for i in range(x - 1, -1, -1):
	cnt = 0
	for j in Ar:
		if i == j:
			cnt = 1
			break
	if cnt == 0:
		ar.append(i)
if x in Ar:
	print(len(ar) + 1)
else:
	print(len(ar))


(n, x) = map(int, input().split(' '))
evil = list(map(int, input().split(' ')))
current = ans = 0
for i in range(x):
	if i not in evil:
		ans += 1
ans += 1 if x in evil else 0
print(ans)


(m, n) = map(int, input().strip().split(' '))
a = list(map(int, input().strip().split(' ')))
b = sorted(a)
num1 = 0
num2 = 0
if n in b:
	for i in range(n):
		if i not in b:
			num1 += 1
	print(str(num1 + 1))
else:
	for i in range(n):
		if i not in b:
			num1 += 1
	print(str(num1))


(n, x) = map(int, input().split())
l = list(map(int, input().split()))
l = sorted(l)
res = 0
if l:
	if x != 0:
		for i in range(min(n, x)):
			if l[i] > x:
				res += 1
			if l[i] == x:
				res += 2
		if n < x:
			res += x - n
		if len(l) > x:
			if l[x] == x:
				res = 1
	elif 0 in l:
		res = 1
else:
	res = x
print(res)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
import random
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
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 list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

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

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

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

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

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

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def main():
	(n, x) = LI()
	a = sorted(LI())
	r = 0
	s = set()
	for c in a:
		if c == x:
			r += 1
		elif c < x:
			s.add(c)
		else:
			break
	r += x - len(s)
	return r
print(main())


[n, x] = list(map(int, input().split()))
a = list(map(int, input().split()))
cnt = 0
flag = 0
for i in range(n):
	if a[i] < x:
		cnt += 1
	elif a[i] == x:
		flag = 1
print(x - cnt + flag)


(n, x) = map(int, input().split())
a = sorted(list(map(int, input().split())))
k = x - 1
count = 0
if x in a:
	count += 1
while k >= 0:
	if k not in a:
		if k != x:
			count += 1
	k -= 1
print(count)


(n, x) = map(int, input().split())
r = x
for i in map(int, input().split()):
	r += (i == x) - (i < x)
print(r)


result_string = input()
number_string = input()
result_numbers = []
number_numbers = []
abc = []
abc.append(result_string.split(' ')[:])
for i in result_string.split(' '):
	result_numbers.append(int(i))
for i in number_string.split(' '):
	number_numbers.append(int(i))
MEX = result_numbers[1]
number_add = 0
number_remove = 0
number_smaller = []
for i in number_numbers:
	if i < MEX:
		number_smaller.append(i)
for i in range(MEX):
	if i not in number_smaller:
		number_add += 1
if MEX in number_numbers:
	number_add += 1
print(number_add)


(n, x) = map(int, input().split())
sets = list(map(int, input().split()))
c = 0

def mex(sets):
	m = 0
	while m in sets:
		m += 1
	return m
if mex(sets) != x:
	if x in sets:
		c = 1
	for i in range(x):
		if i not in sets:
			c += 1
print(c)


(n, x) = map(int, input().split())
set1 = set(map(int, input().split()))
set2 = set()
for i in range(x + 1):
	set2.add(i)
set3 = set2 - set1
if x in set3:
	print(len(set3) - 1)
else:
	print(len(set3) + 1)


(n, x) = list(map(int, input().split()))
p = list(map(int, input().split()))
yy = 0
tam = list(range(0, x))
if x == 0:
	if 0 in p:
		print(1)
	else:
		print(0)
else:
	p.sort()
	for it in tam:
		if it in p:
			pass
		else:
			yy += 1
	if x in p:
		yy += 1
	else:
		pass
	print(yy)


(n, x) = list(map(int, input().split()))
inpt = list(map(int, input().split()))
counter = 0
if x in inpt:
	counter += 1
for i in range(0, x):
	if i not in inpt:
		counter += 1
print(counter)


(n, x) = map(int, input().split())
lst = []
for y in input().split():
	lst.append(int(y))
lst.sort()
k = 0
for y in range(0, x):
	if not y in lst:
		k += 1
if x in lst:
	print(k + 1)
else:
	print(k)


inp = [int(i) for i in input().split(' ')]
st = [int(i) for i in input().split(' ')]
cnt = inp[1]
for j in range(len(st)):
	if st[j] >= 0 and st[j] < inp[1]:
		cnt -= 1
	if st[j] == inp[1]:
		cnt += 1
print(cnt)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
b = [False for i in range(x + 1)]
a.sort()
for i in range(len(a)):
	if a[i] > x:
		break
	b[a[i]] = True
o = 0
for i in range(x):
	if b[i] == False:
		o += 1
if b[x]:
	o += 1
print(o)


(n, x) = map(int, input().split())
A = list(map(int, input().split()))
c = 0
ans = 0
for i in A:
	if i < x:
		c += 1
	if i == x:
		ans += 1
ans += x - c
print(ans)


(N, MEX) = map(int, input().split())
A = list(map(int, input().split()))
Need = [False] * MEX
A.sort()
toKill = 0
for i in A:
	if i < MEX:
		if Need[i] == False:
			Need[i] = True
		else:
			toKill += 1
	if i == MEX:
		toKill += 1
print(toKill + Need.count(False))


(n, x) = map(int, input().split())
A = [0] * 101
for a in map(int, input().split()):
	A[a] = 1
print(A[x] if x == 0 else A[x] + x - sum(A[:x]))


def index(mas, x):
	for i in range(len(mas)):
		if mas[i] == x:
			return i
(n, x) = map(int, input().split())
mas = list(map(int, input().split()))
mas.sort()
if x in mas:
	s = 1
	s += x - index(mas, x)
else:
	s = 0
	for i in range(x):
		if i not in mas:
			s += 1
print(s)


(n, x) = map(int, input().split())
a = [i for i in map(int, input().split())]
cnt = 0
for i in range(x):
	if i not in a:
		cnt += 1
if x in a:
	cnt += 1
print(cnt)


import sys
L = sys.stdin.readline().strip().split(' ')
n = int(L[0])
x = int(L[1])
evil = []
for i in range(101):
	evil.append(0)
L = sys.stdin.readline().strip().split(' ')
for i in range(len(L)):
	evil[int(L[i])] = 1
ans = 0
for i in range(x + 1):
	if i < x:
		if evil[i] == 0:
			ans += 1
	elif evil[i] == 1:
		ans += 1
print(ans)


I = lambda : map(int, input().split())
(n, x) = I()
s = set(I())
a = list(set(range(0, x)) - s)
print(len(a) + (x in s))


(a, b) = map(int, input().split())
arr = list(map(int, input().split()))
arr.sort()
ctr = 0
flag = False
for i in arr:
	if i < b:
		ctr += 1
	elif i == b:
		flag = True
	else:
		break
if flag:
	print(b + 1 - ctr)
else:
	print(b - ctr)


a = [int(x) for x in input().split()]
b = [int(y) for y in input().split()]
c = [int(z) for z in range(a[1])]
d = [x for x in b if x != a[1]]
count = 0
if len(b) - len(d):
	count = 1
set1 = set(d)
set1.update(set(c))
print(count + (len(set1) - len(d)))


(n, x) = map(int, input().split())
S = set(map(int, input().split()))
ans = 0
if x in S:
	ans += 1
ans += x - len(set(range(x)) & S)
print(ans)


def ok(arr1, k):
	res = 0
	for i in range(k):
		if i not in arr1:
			res += 1
	return res
(n, k) = map(int, input().split())
arr1 = set(list(map(int, input().split())))
ans = ok(arr1, k)
print(ans + 1 if k in set(arr1) else ans)


(n, m) = map(int, input().split())
c = 0
ls = sorted(list(map(int, input().split())))
for i in ls:
	if i >= m:
		break
	c += 1
print(abs(m - c) + (1 if m in ls else 0))


(n, k) = map(int, input().split())
x = sorted(list(map(int, input().split())))
(cnt_less, cnt_equal) = (0, 0)
for i in range(n):
	if x[i] < k:
		cnt_less += 1
	elif x[i] == k:
		cnt_equal += 1
	else:
		break
print(k - cnt_less + cnt_equal)


(n, x) = map(int, input().split())
ai = list(map(int, input().split()))
cnt = 0
if x in ai:
	cnt += 1
ai.append(x)
ai.sort()
i = ai.index(x)
cnt += x - i
print(cnt)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
answer = x
for i in a:
	if i < x:
		answer -= 1
	elif i == x:
		answer += 1
print(answer)


import sys

def performOperation(set, target):
	mex = calculateMex(set)
	if mex < target:
		set += [mex]
		return 0
	if mex > target:
		if target in set:
			set.remove(target)
		else:
			del set[-1]
		return 0
	return 1

def calculateMex(set):
	for ii in range(len(set)):
		if ii not in set:
			return ii
	return len(set)
inputtext = input().split(' ')
n = int(inputtext[0])
target = int(inputtext[1])
if n == 0:
	print(0)
	sys.exit()
set = [int(x) for x in input().split()]
if calculateMex(set) == target:
	print(0)
else:
	count = 0
	while performOperation(set, target) != 1:
		count += 1
	print(count)


(n, e) = map(int, input().split())
l = list(map(int, input().split()))
m = 0
if e in l:
	m += 1
while min(l) <= e:
	e -= 1
	if e not in l:
		m += 1
m += e
print(m)


(n, x) = map(int, input().split())
l = [int(i) for i in input().split()]
l.sort()
try:
	l.remove(x)
	op = 1
except:
	op = 0
MEX = 0
for i in range(n - op):
	if l[i] == MEX:
		MEX += 1
	else:
		break
for i in range(n - op):
	if l[i] > MEX and l[i] < x:
		op -= 1
print(abs(x - MEX) + op)


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


(n, x) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [1] * 101
for i in a:
	b[i] = 0
c = sum(b[:x])
if x in a:
	c += 1
print(c)


(n, x) = map(int, input().split())
mass = input().split()
result = 0
mass.sort()
for i in range(len(mass)):
	if int(mass[i]) < x:
		result += 1
result = x - result
for i in range(len(mass)):
	if int(mass[i]) == x:
		result += 1
print(result)


(n, mex) = map(int, input().split())
s = list(map(int, input().split()))
c = 0
if mex in s:
	c += 1
for i in range(mex):
	if i not in s:
		c += 1
print(c)


(n, x) = list(map(int, input().split()))
arr = set(list(map(int, input().split())))
a = set([i for i in range(101)])
a = sorted(a - arr)
count = 0
if x not in a:
	count += 1
	a.append(x)
	a = sorted(a)
for i in a:
	count += 1
	if i == x:
		break
print(count - 1)


(n, x) = map(int, input().split())
a = [i for i in map(int, input().split()) if i <= x]
c = i = 0
while i < x:
	if i not in a:
		c += 1
	i += 1
print(c if x not in a else c + 1)


(n, x) = [int(c) for c in input().split()]
length = 0
xinarray = False
for e in input().split():
	i = int(e)
	if i <= x:
		length += 1
		if i == x:
			xinarray = True
if length == x + 1:
	res = 1
else:
	res = x - length
	if xinarray:
		res += 2
print(res)


def solve():
	(n, x) = [int(st) for st in input().split(' ')]
	numset = [int(st) for st in input().split(' ')]
	ans = 0
	for num in numset:
		if num < x:
			ans += 1
	if x in numset:
		return x - ans + 1
	return x - ans
print(solve())


(x, n) = input().split()
mass = list(map(int, input().split()))
count = 0
for i in range(int(n)):
	if i in mass:
		pass
	else:
		count += 1
if int(n) in mass:
	count += 1
print(count)


def solve(n, mex, arr):
	count = 0
	if mex in arr:
		count += 1
	for i in range(mex):
		if i not in arr:
			count += 1
	return count

def main():
	(n, k) = list(map(int, input().split(' ')))
	arr = list(map(int, input().split(' ')))
	print(solve(n, k, arr))
main()


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


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
an = 0
i = 0
while i < n:
	if a[i] < t:
		an += 1
	else:
		break
	i += 1
print(t - an + int(t in a))


(n, x) = [int(f) for f in input().split()]
a = set([int(f) for f in input().split()])
b = set(list(range(x)))
print(len(b.difference(a)) + int(x in a))


from bisect import bisect
(n, k) = [int(x) for x in input().strip().split()]
arr = [False for _ in range(101)]
inp = [int(x) for x in input().strip().split()]
for i in inp:
	arr[i] = True
count = 1 if arr[k] else 0
for i in range(0, k):
	if not arr[i]:
		count += 1
print(count)


def fin(n):
	global a
	for i in a:
		if i == n:
			return True
	return False
(n, x) = map(int, input().split())
a = [int(i) for i in input().split()]
count = 0
a.sort()
if fin(x) == True:
	count += 1
for i in range(x):
	if fin(i) == False:
		count += 1
print(count)


q = 1
while q > 0:
	q -= 1
	(n, x) = map(int, input().strip().split())
	a = [int(x) for x in input().strip().split(' ')]
	a = [y for y in a if y >= 0]
	count = 0
	a = sorted(a)
	for i in range(0, x):
		if i not in a:
			count += 1
	if x in a:
		count += 1
	print(count)


(n, x) = map(int, input().split())
arr = list(map(int, input().split()))
arr.append(-1)
arr = sorted(arr)
if x < arr[1]:
	print(x)
elif x > arr[n]:
	print(x - n)
else:
	s = 0
	for i in range(1, n + 1):
		s += arr[i] - arr[i - 1] - 1
		if x == arr[i]:
			print(s + 1)
			exit(0)
		elif x < arr[i] and x > arr[i - 1]:
			print(s - (arr[i] - x))
			exit(0)


(n, mix) = input().split()
(n, mix) = (int(n), int(mix))
arr = list(map(int, input().split()))
arr.sort()
ans = 0
missing = []
for x in range(mix + 1):
	if x not in arr:
		ans += 1
		missing.append(x)
if mix in missing:
	print(len(missing) - 1)
elif min not in missing:
	print(len(missing) + 1)
else:
	print(1)


a = input().split()
b = input().split()
c = 0
for i in b:
	b[c] = int(i)
	c = c + 1
x = int(a[1])
b.sort()
b.insert(0, -1)
b.append(x + 1)
i = 1
c = 0
while b[i] < x:
	c = c + b[i] - b[i - 1] - 1
	i = i + 1
c = c + x - b[i - 1] - 1 + b.count(x)
print(c)


(a, b) = map(int, input().split())
c = list(map(int, input().split()))
k = 0
for i in range(b):
	if (i in c) == False:
		k += 1
if (b in c) == True:
	k += 1
print(k)


R = lambda : map(int, input().split())
(n, x) = R()
a = set(R())
print(len(set(range(0, x)) - a) + (x in a))


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


from math import *
(n, x) = map(int, input().split())
inp = list(map(int, input().split()))
cnt = 0
flag = 0
for i in inp:
	if i < x:
		cnt += 1
	elif i == x:
		flag = 1
print(x - cnt + flag)


(n, x) = list(map(int, input().split()))
array = list(map(int, input().split()))
array.sort()
cnt = i = 0
while i < n:
	if array[i] >= x:
		if array[i] == x:
			cnt = 1
		break
	i += 1
print(cnt + x - i)


(n, target) = map(int, input().split())
nums = sorted(list(map(int, input().split())))
ops = target
for i in range(n):
	if nums[i] < target:
		ops -= 1
	else:
		break
if target in nums:
	ops += 1
print(ops)


(n, x) = map(int, input().split())
set1 = set(map(int, input().split()))
set2 = set()
for i in range(0, x + 1):
	set2.add(i)
set3 = set2 - set1
if x in set3:
	print(len(set3) - 1)
elif bool(set3) and x not in set3:
	print(len(set3) + 1)
else:
	print(len(set3) + 1)


while True:
	try:
		(n, x) = map(int, input().split())
	except:
		break
	thelist = list(map(int, input().split()))
	thelist.sort()
	time1 = time2 = 0
	for i in range(0, x):
		if i not in thelist:
			time1 += 1
	time1 = time1 + thelist.count(x)
	print(time1)


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


(n, x) = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
if x < l[0]:
	print(x)
elif x not in l:
	sum = 0
	for i in range(0, x):
		if i not in l:
			sum = sum + 1
	print(sum)
elif x in l:
	sum = 1
	for i in range(0, x):
		if i not in l:
			sum = sum + 1
	print(sum)


arr = list(map(int, input().strip().split(' ')))
(n, x) = (arr[0], arr[1])
arr = list(map(int, input().strip().split(' ')))
ans = 0
if x in arr:
	ans += 1
	cnt = 0
	for i in arr:
		if i < x:
			cnt += 1
	ans += x - cnt
else:
	for i in arr:
		if i < x:
			ans += 1
	ans = x - ans
print(ans)


(n, mex) = map(int, input().split())
l = list(map(int, input().split()))
counter = 0
l = sorted(l)
if mex in l:
	counter += 1
for i in range(mex):
	if not i in l:
		counter += 1
print(counter)


(n, x) = list(map(int, input().split(' ')))
arr = list(map(int, input().split(' ')))
arr1 = range(0, x)
num = arr.count(x)
for i in arr1:
	if i not in arr:
		num += 1
print(num)


import sys
import math
import bisect
import itertools
import random
import re

def main():
	(n, m) = map(int, input().split())
	A = list(map(int, input().split()))
	ans = 0
	for i in range(m):
		if i not in A:
			ans += 1
	if m in A:
		ans += 1
	print(ans)
main()


args = [int(i) for i in input().split()]
n = args[0]
x = args[1]
arr = [int(x) for x in input().split()]
arr.sort()
count = 0
if arr[len(arr) - 1] < x:
	count = x - n
else:
	for i in range(0, len(arr)):
		if arr[i] < x:
			continue
		elif arr[i] == x:
			count = x - i + 1
			break
		else:
			count = x - i
			break
print(count)


(n, x) = map(int, input().split())
arr = list(map(int, input().split()))[:n]
ans = 0
myMap = {}
for i in range(n):
	myMap[arr[i]] = 1
for i in range(x):
	if myMap.get(i) is None:
		ans += 1
if myMap.get(x) is not None:
	ans += 1
print(ans)


d = input()
a = int(d.split(' ')[0])
mex = int(d.split(' ')[1])
d = input()
arr = []
for i in d.split(' '):
	arr.append(int(i))
arr = sorted(arr)
res = 0
for i in range(0, mex):
	if not i in arr:
		res += 1
if mex in arr:
	res += 1
print(res)


nk = input().split()
(n, x) = (int(nk[0]), int(nk[1]))
a = input().split()
arr = []
for i in a:
	arr.append(int(i))
freq = [0] * 101
for i in arr:
	freq[i] += 1
count = 0
for i in range(0, x):
	if freq[i] == 0:
		count += 1
if freq[x] == 1:
	count += 1
print(count)


(n, x) = list(map(int, input().split(' ')))
arr = list(map(int, input().split(' ')))
s = [0 for i in range(x)]
t = 0
for i in arr:
	if i < x:
		s[i] = 1
	elif i == x:
		t += 1
print(x - sum(s) + t)


(n, x) = map(int, input().split())
nn = list(map(int, input().split()))
nn.sort()
xx = x
if x < nn[0]:
	print(x)
elif x not in nn:
	while xx not in nn:
		xx -= 1
	print(x - nn.index(xx) - 1)
else:
	print(x - nn.index(x) + 1)


(n, x) = map(int, input().split())
arr = map(int, input().split())
ss = set(arr)
cnt = 0
for i in range(x):
	if i not in ss:
		cnt += 1
if x in ss:
	cnt += 1
print(cnt)


def input_numbers():
	return list(map(int, input().split()))
(n, x) = input_numbers()
s = set(input_numbers())
i = 0
count = 0
while i < x:
	if not i in s:
		count += 1
	i += 1
if x in s:
	count += 1
print(count)


(n, x) = map(int, input().split())
l = set(list(map(int, input().split())))
count = 0
c = max(max(l) + 1, x + 1)
if x in l:
	count += 1
	l.remove(x)
for i in range(0, x + 1):
	if i == x:
		continue
	elif i not in l:
		count += 1
print(count)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
res = sum([1 if _ < m else 0 for _ in a])
print(m - res + a.count(m))


(n, x) = map(int, input().split())
arr = list(map(int, input().split()))
arr.sort()
ans = 0
for i in range(x):
	if i not in arr:
		ans = ans + 1
excess = arr.count(x)
ans = ans + excess
print(ans)


(n, mex) = map(int, input().split())
numbers = list(map(int, input().split()))
operations = 0
if mex in numbers:
	numbers.remove(mex)
	operations += 1
for x in range(0, 101):
	if x == mex:
		break
	if x not in numbers:
		operations += 1
print(operations)


import sys
import math
import itertools
import collections

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = prime[1] = False
	r = [p for p in range(n + 1) if prime[p]]
	return r

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 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, x) = mi()
a = sorted(li())
ans = 0
for i in range(x):
	if i not in a:
		a.append(i)
		ans += 1
if x in a:
	ans += 1
print(ans)


(size, n) = map(int, input().split())
s = [int(e) for e in input().split()]
k = 0
for i in range(n):
	if not i in s:
		k += 1
if n in s:
	k += 1
print(k)


(n, k) = tuple(map(int, input().split()))
a = list(map(int, input().split()))
res = 0
l = 0
for el in a:
	if el < k:
		l += 1
if k in a:
	res += 1
res += k - l
print(res)


(n, x) = [int(_) for _ in input().split()]
a = [int(_) for _ in input().split()]
ans = len([y for y in range(101) if y < x and y not in a])
ans += 1 if x in a else 0
print(ans)


(_, x) = [int(x) for x in input().split(' ')]
s = set([int(i) for i in input().split(' ') if int(i) <= x])
d = set(range(x)).symmetric_difference(s)
print(len(d))


import sys
input_str = input()
n = int(input_str.split(' ')[0])
x = int(input_str.split(' ')[1])
input_str = input()
a = [int(str) for str in input_str.split(' ')]
map = {}
for i in range(0, 101):
	map[i] = 0
for i in a:
	map[i] += 1
result = 0
for i in range(0, x):
	if map[i] == 0:
		result += 1
result += map[x]
print(result)


(n, x) = map(int, input().split())
a = [int(s) for s in input().split()]
answer = x
for i in range(len(a)):
	if a[i] < x:
		answer -= 1
	if a[i] == x:
		answer += 1
print(answer)


(n, x) = list(map(int, input().split()))
a = list(map(int, input().split()))
res = x - sum([1 for ai in a if ai < x])
if x in a:
	res += 1
print(res)


(_, x) = [int(num) for num in input().split()]
ll = [int(num) for num in input().split()]
ll = [token for token in ll if token <= x and token >= 0]
if x in ll:
	print(x - len(ll) + 2)
else:
	print(x - len(ll))


(n, x) = input().split()
(n, x) = (int(n), int(x))
ops = x
for i in input().split():
	a = int(i)
	if 0 <= a < x:
		ops -= 1
	elif a == x:
		ops += 1
print(ops)


import sys
from collections import Counter
sys.setrecursionlimit(10 ** 6)
(n, x) = list(map(int, input().split()))
a = list(map(int, input().split()))
b = x
a.sort()
i = 0
while i < len(a) and a[i] <= x:
	if a[i] == x:
		b = b + 1
	else:
		b = b - 1
	i = i + 1
print(b)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
f = [0 for i in range(101)]
c = 0
for i in range(n):
	f[a[i]] += 1
for i in range(101):
	if f[i] == 0 and i < x:
		c += 1
if f[x] > 0:
	c += 1
print(c)


read = lambda : map(int, input().split())
(n, x) = read()
a = sorted(list(read()))
b = a[n - 1] + 1
exist = False
c = 0
for i in range(n):
	if i < a[i]:
		b = min(b, i)
	if a[i] == x:
		exist = True
	if a[i] < x:
		c += 1
ans = 0
if b <= x:
	ans = x - c
	if exist:
		ans += 1
else:
	ans = 1
print(ans)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
arr = []
for i in a:
	if i == k:
		ans += 1
	elif i < k:
		arr.append(i)
for i in range(k):
	if i not in arr:
		ans += 1
print(ans)


(n, x) = map(int, input().strip().split(' '))
A = list(map(int, input().strip().split(' ')))
b = set()
c = 0
for i in range(x):
	b.add(i)
for a in A:
	if a == x:
		c = 1
	try:
		b.remove(a)
	except:
		continue
print(len(b) + c)


(n, x) = map(int, input().split())
a = sorted(map(int, input().split()))
mex = 0
for i in a:
	if i == mex:
		mex += 1
	else:
		break
ans = None
if mex == x:
	ans = 0
elif mex > x:
	ans = 1
else:
	ans = x - len(list(filter(lambda num: num < x, a))) + len(list(filter(lambda num: num == x, a)))
print(ans)


(numbers_nr, evil_value) = (int(x) for x in input().split())
numbers = [int(x) for x in input().split()]
ans = 0
if evil_value in numbers:
	ans += 1
for value in range(0, evil_value):
	if value not in numbers:
		ans += 1
print(ans)


f = lambda : map(int, input().split())
(n, x) = f()
t = [0] * 101
for i in f():
	t[i] = 1
print(t[:x].count(0) + t[x])


(n, x) = map(int, input().split())
v = [int(i) for i in input().split()]
cont = [0] * 200
for i in v:
	cont[i] += 1
res = 0
for i in range(x):
	if cont[i] == 0:
		res += 1
if cont[x] == 1:
	res += 1
print(res)


(n, x) = map(int, input().split())
arr = [int(i) for i in input().split()]
p = [0] * 200
for i in arr:
	p[i] += 1
ans = 0
for i in range(x):
	if p[i] == 0:
		ans += 1
ans += p[x]
print(ans)


(n, x) = list(map(int, input().split(' ')))
arr = list(map(int, input().split(' ')))
s = set()
t = 0
for i in arr:
	if i < x:
		s.add(i)
	elif i == x:
		t += 1
print(x - len(s) + t)


(n, x) = map(int, input().split())
l = list(map(int, input().split()))
set_ = set(l)
if x in set_:
	to = 1
else:
	to = 0
for i in range(x):
	if i not in set_:
		to += 1
print(to)


def is_evil(array, m):
	if True or m < array[-1]:
		array2 = [False] * 101
	else:
		array2 = [False] * (m + 1)
	for (i, item) in enumerate(array):
		array2[item] = True
	changes = 0
	for i in range(m):
		if not array2[i]:
			array2[i] = True
			changes += 1
	if array2[m]:
		array2[m] = False
		changes += 1
	return changes
while True:
	try:
		case = input()
		temp = case.split(' ')
		m = int(temp[1])
		array = input()
		array = array.rstrip().split(' ')
		for i in range(len(array)):
			array[i] = int(array[i])
		print(is_evil(array, m))
	except EOFError:
		break


(n, x) = map(int, input().split())
l = set(map(int, input().split()))
l1 = list(l)
c = 0
a = min(l1)
for i in l1:
	if i < x:
		c = c + 1
	else:
		break
if x not in l1:
	print(x - c)
else:
	print(x - c + 1)


(n, x) = map(int, input().split())
xs = [int(i) for i in input().split()]
smaller_than_x = [p for p in xs if p < x]
print(x - len(smaller_than_x) + int(x in xs))


def R():
	return map(int, input().split())
(n, x) = R()
a = list(R())
print(len(set(range(0, x)) - set(a)) + (x in a))


import random

def quckSort(intArr, left, right):
	if left > right:
		return
	(mid, l, r) = (intArr[left], left, right)
	while l < r:
		while mid <= intArr[r] and l < r:
			r -= 1
		intArr[l] = intArr[r]
		while mid >= intArr[l] and l < r:
			l += 1
		intArr[r] = intArr[l]
	intArr[l] = mid
	quckSort(intArr, left, l - 1)
	quckSort(intArr, l + 1, right)

def bin_search(data_list, val):
	low = 0
	high = len(data_list) - 1
	while low <= high:
		mid = (low + high) // 2
		if data_list[mid] == val:
			return (1, mid)
		elif data_list[mid] > val:
			high = mid - 1
		else:
			low = mid + 1
	return (0, low)

def main():
	(n, x) = map(int, input().split())
	num_list = list(map(int, input().split()))
	quckSort(num_list, 0, n - 1)
	search_res = bin_search(num_list, x)
	ans = x - search_res[1] + search_res[0]
	print(ans)
main()


(n, x) = map(int, input().split())
mas = list(map(int, input().split()))
q = 0
if x in mas:
	del mas[mas.index(x)]
	q = 1
mas.sort()
a = set(range(x))
b = set(mas)
per = list(a & b)
print(len(a) - len(per) + q)


(n, x) = map(int, input().split())
list = [int(i) for i in input().split()]
list.sort()
(i, cnt) = (0, 0)
while i < x:
	j = 0
	while j < n:
		if list[j] == i:
			break
		j += 1
	if j == n:
		cnt += 1
	i += 1
i = 0
while i < n:
	if x == list[i]:
		cnt += 1
		break
	i += 1
print(cnt)


(n, x) = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
if (x in a) == True:
	ans = 1
a.sort()
ans = ans + x
for i in range(x):
	if (i in a) == True:
		ans = ans - 1
print(ans)


(n, x) = map(int, input().split(' '))
s = list(map(int, input().split(' ')))
s = set(s)
a = 0
b = 0
c = 0
for i in s:
	if i > x:
		a += 1
	elif i < x:
		b += 1
	else:
		c += 1
if c == 0:
	print(x - b)
else:
	print(x - b + 1)


def mex(a):
	mex = 0
	while mex in a:
		mex += 1
	return mex
(n, x) = list(map(int, input().split()))
a = set(map(int, input().split()))
mexa = mex(a)
counter = 0
if mexa > x:
	print(1)
else:
	for i in range(mexa, x):
		if i not in a:
			counter += 1
	if x in a:
		counter += 1
	print(counter)


def main():
	firstLine = input()
	secondLine = input()
	n = int(firstLine.split()[0])
	x = int(firstLine.split()[1])
	nums = []
	for i in secondLine.split():
		nums.append(int(i))
	count = 0
	if x in nums:
		count += 1
	for i in range(x):
		if i in nums:
			pass
		else:
			count += 1
	print(count)
main()


(_, x) = map(int, input().split())
A = set(map(int, input().split()))
print(sum((a not in A for a in range(x))) + (x in A))


(_, x) = map(int, input().split())
l = sorted(map(int, input().split()))
op = 0
val = 0
i = 0
while i < len(l):
	if val > x:
		break
	while l[i] > val:
		if val < x:
			op += 1
		val += 1
	if l[i] == x:
		op += 1
	if l[i] == val:
		i += 1
		val += 1
if i >= len(l) - 1 and val < x:
	op += x - val
print(op)


(n, x) = [int(i) for i in input().split()]
lista = [int(i) for i in input().split()]
aux = [0 for i in range(200)]
for i in lista:
	aux[i] += 1
ans = 0
for i in range(x):
	if aux[i] == 0:
		ans += 1
if aux[x] == 1:
	ans += 1
print(ans)


(n, x) = map(int, input().split())
set1 = set(map(int, input().split()))
count = 0

def mex(set1):
	if set1 == set():
		minn = 0
		return minn
	else:
		minn = min(set1)
		rst = minn
	if minn > 0:
		rst = 0
		return rst
	rst = minn
	while minn == 0:
		rst += 1
		if rst not in set1:
			return rst
		else:
			continue
lol = mex(set1)
if lol == x:
	print(0)
else:
	while lol != x:
		if lol > x:
			if x in set1:
				set1.discard(x)
				count += 1
				lol = mex(set1)
				continue
			else:
				try:
					set1.discard(min(set1))
					count += 1
				except ValueError:
					print(count)
					break
		else:
			count += len(set(range(lol, x)) - set1)
			set1.update(set(range(lol, x)) - set1)
		lol = mex(set1)
		continue
	else:
		print(count)


(n, x) = map(int, input().strip().split())
l = set(map(int, input().strip().split()))
count = 1 if x in l else 0
count += len(set(range(x)) - l)
print(count)


(n, x) = input().split()
n = int(n)
x = int(x)
arr = [int(x) for x in input().split()]
count = int(0)
i = int(0)
val = 0
arr.sort()
if arr[n - 1] < x:
	count = x - n
else:
	while val < x:
		if arr[i] != val:
			count = count + 1
		else:
			i = i + 1
		val = val + 1
if x in arr:
	count = count + 1
print(count)