import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class R435A {

    FastScanner sc;
    PrintWriter out;

    int n;
    int x;
    int[] arr;

    public void solve()  {
        n = sc.nextInt();
        x = sc.nextInt();
        arr = new int[n];

        int res = x;

        for (int i=0; i<n; i++) {
            int cur = sc.nextInt();
            if (cur < x) res--;
            if (cur == x) res++;
        }

        System.out.println(res);

    }

    private void run() {
      // sc = new FastScanner(new File("input.txt"));
        sc = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();
        out.close();
    }

    public static void main(String[] args) {
        new R435A().run();
    }

    private class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

//package CodeForces;

/*In the name of Allah the Most Merciful.
 * Author
 * Md. Toufiqul Islam
 * Dept. Of CSE
 * Ahsanullah University Of Science And Technology
*/
import java.util.*;
import java.io.*;
public class R435A {

          //Code for Faster Input
    	  public static class MyScanner {

    	      BufferedReader br;
    	      StringTokenizer st;

    	      public MyScanner() {
    	         br = new BufferedReader(new InputStreamReader(System.in));
    	      }

    	      String next() {
    	          while (st == null || !st.hasMoreElements()) {
    	              try {
    	                  st = new StringTokenizer(br.readLine());
    	              } catch (IOException e) {
    	                  e.printStackTrace();
    	              }
    	          }
    	          return st.nextToken();
    	      }

    	      int nextInt() {
    	          return Integer.parseInt(next());
    	      }

    	      long nextLong() {
    	          return Long.parseLong(next());
    	      }

    	      double nextDouble() {
    	          return Double.parseDouble(next());
    	      }

    	      String nextLine(){
    	          String str = "";
    		  try {
    		     str = br.readLine();
    		  } catch (IOException e) {
    		     e.printStackTrace();
    		  }
    		  return str;
    	      }

    	   }
    	   //--------------------------------------------------------

    static int getMex(List<Integer> list) {

    	      for(int i=0;i<=100;i++){
    	          if(!list.contains(new Integer(i))){
    	              return i;
                  }
              }
              return -1;
    }
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        int n = sc.nextInt();
        int x = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.nextInt());

        }

        int count = 0;
        Collections.sort(list);
        if(list.contains(new Integer(x))){
            list.remove(new Integer(x));
            count++;
        }

       while (true){

            int m = getMex(list);
         //  System.out.println(m);
           if(m!=x){
               list.add(m);
               count++;

           }

           if(m==x){
               System.out.println(count);
               break;
           }

       }
    }

}

import java.util.ArrayList;
import java.util.Scanner;

public class EvilSet {

	public static void main(String[] args)
	{
		Scanner inp=new Scanner(System.in);
		int n=inp.nextInt();
		int x=inp.nextInt();

		ArrayList<Integer> set=new ArrayList<>();
		for(int i=0;i<n;i++)
		{
			set.add(inp.nextInt());
		}
		int o=findOper(set,x);
		System.out.println(o);
		inp.close();
	}

	private static int findOper(ArrayList<Integer> set, int x)
	{
		int count=0;
		for(int i=0;i<x;i++)
		{
			if(!set.contains(i))
				count++;
		}
		if(set.contains(x))
			count++;
		return count;
	}

}

import java.util.*;
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Logan
 */
public class Mex {
    public static void main(String args[]){
        Scanner sc= new Scanner(System.in);
        int n= sc.nextInt();
        int num=sc.nextInt();
        HashSet<Integer> hs= new HashSet<Integer>();
        int arr[]= new int[n];
        for(int i=0;i<n;i++){
            arr[i]=sc.nextInt();
            hs.add(arr[i]);
        }
        int i=0;
        for(i=0;i<n;i++)
            if(!hs.contains(i))
                break;
        int mex=i;
        int count=0;
        //System.out.println("MEX: "+mex);
        if(mex<num){
            for(i=mex;i<num;i++)
                if(!hs.contains(i))
                    count++;
            if(hs.contains(num))
                count++;
        }
        if(mex>num){
            count=1;

        }
        System.out.println(count);
    }
}

import java.util.Arrays;
import java.util.Scanner;
import java.io.PrintWriter;

public class P862A_Mahmoud_and_Ehab_and_the_MEX {

/* the MEX of the set {0, 2, 4} is 1 and the MEX of the set {1, 2, 3} is 0 .
 * Category: Implementation
 * 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
input
1 50
0
output
49
input
2 50
1 100
output
49
 */
	private Scanner in = new Scanner(System.in);
	private PrintWriter pw = new PrintWriter(System.out);

	public static void main(String[] args) {
		(new P862A_Mahmoud_and_Ehab_and_the_MEX()).solve();
	}

	public void solve() {
		int n = in.nextInt();
		int x = in.nextInt();

		int[] A = new int[n];
		int answer = 0, r = 0, i;
		int nInsertions;

		for (i = 0; i < n; i++) {
			A[i] = in.nextInt();
		}

		Arrays.sort(A);

		for (i = 0; i < n && A[i] < x; i++) {
			nInsertions = A[i] - r;
		    if (nInsertions > 0) {
		        answer += nInsertions;
		    }

		    r = A[i] + 1;
		}

		nInsertions = x - r;
	    if (nInsertions > 0) {
	        answer += nInsertions;
		}

	    if (i < n && A[i] == x) {
			answer++;
		}

		pw.printf("%d\n", answer);
		pw.flush();
	}
}

/**
 *
 */
//package codeforces;
import java.util.*;
/**
 * @author Shivansh Singh
 *
 */
public class Cf862A {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		int n,x,i,c=0;
		n=sc.nextInt();
		x=sc.nextInt();
		Set<Integer> set=new HashSet<>();
		for (i=0;i<n;i++)
			set.add(sc.nextInt());
		for (i=0;i<x;i++) {
			if(!set.contains(i))
				c++;
		}
		if(set.contains(x))
			c++;
		System.out.println(c);
		sc.close();
	}

}

import java.io.*;
import java.text.*;
import java.util.*;
import java.math.*;
public class template {
	public static void main(String[] args) throws Exception {
		new template().run();
	}
	public void run() throws Exception {
		FastScanner f = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		///
		int n = f.nextInt();
		int x = f.nextInt();
		int cnt = x;
		boolean[] b = new boolean[x];
		while(n-->0) {
			int a = f.nextInt();
			if(a < x && !b[a]) {
				b[a] = true;
				cnt--;
			}
			if(a == x) cnt++;
		}
		out.println(cnt);
		out.flush();
	}
///
	static class FastScanner {
		public BufferedReader reader;
		public StringTokenizer tokenizer;
		public FastScanner() {
			reader = new BufferedReader(new InputStreamReader(System.in), 32768);
			tokenizer = null;
		}
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch(IOException e) {
				throw new RuntimeException(e);
			}
		}
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.stream.Stream;

public class Main {

    public static void main(String[] args) {

        FastReader in = new FastReader();

        int n=in.nextInt();

        int mex=in.nextInt();

        int[]x=new int[n];

        boolean[]vis=new boolean[110];

        int max=0;

        for (int i=0;i<n;i++){
            x[i]=in.nextInt();
            vis[x[i]]=true;
            max=x[i]>max?x[i]:max;
        }

        int countOperation=0;

        for(int i=0;i<mex;i++){
            int a=i;

            if(!vis[i]){
                countOperation++;
            }
        }

        countOperation = vis[mex]?countOperation+1:countOperation;

        System.out.println(countOperation);

    }

}

class FastReader {

    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }
}

import java.util.*;

public class MEX {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt(), m=scan.nextInt();
		HashSet<Integer> h=new HashSet<>();
		for(int i=0;i<n;i++) h.add(scan.nextInt());
		int res=0;
		if(h.contains(m))res++;
		for(int i=0;i<m;i++) {
			if(!h.contains(i))res++;
		}
		System.out.println(res);
	}
}

/*
 * Author Ayub Subhaniya
 * Institute DA-IICT
 */

import java.io.*;
import java.util.*;

public class Codeforces429A
{

	InputStream in;
	PrintWriter out;

	void solve()
	{
		int n=ni();
		int x=ni();
		boolean present[]=new boolean[102];
		int cnt[]=new int[102];
		for (int i=0;i<n;i++)
		{
			int num=ni();
			present[num]=true;
			cnt[num]++;
		}
		int mex=0;
		while (present[mex])
			mex++;
		if (mex==x)
		{
			out.println(0);
		}
		else if (mex>x)
		{
			out.println(cnt[x]);
		}
		else
		{
			int c=0;
			for (int i=mex;i<x;i++)
				if (!present[i])
					c++;
			c+=cnt[x];
			out.println(c);
		}
	}

	void run() throws Exception
	{
		String INPUT = "C:/Users/ayubs/Desktop/input.txt";
		in = oj ? System.in : new FileInputStream(INPUT);
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis() - s + "ms");

	}
	public static void main(String[] args) throws Exception
	{
		new Codeforces429A().run();
	}

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf)
		{
			ptrbuf = 0;
			try
			{
				lenbuf = in.read(inbuf);
			}
			catch (IOException e)
			{
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean inSpaceChar(int c)
	{
		return !(c >= 33 && c <= 126);
	}

	private int skip()
	{
		int b;
		while ((b = readByte()) != -1 && inSpaceChar(b))
			;
		return b;
	}

	private double nd()
	{
		return Double.parseDouble(ns());
	}

	private char nc()
	{
		return (char) skip();
	}

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(inSpaceChar(b)))
		{ // when nextLine, (inSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(inSpaceChar(b)))
		{
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-')
		{
			minus = true;
			b = readByte();
		}

		while (true)
		{
			if (b >= '0' && b <= '9')
			{
				num = num * 10 + (b - '0');
			}
			else
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-')
		{
			minus = true;
			b = readByte();
		}

		while (true)
		{
			if (b >= '0' && b <= '9')
			{
				num = num * 10 + (b - '0');
			}
			else
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

	private void tr(Object... o)
	{
		if (!oj)
			System.out.println(Arrays.deepToString(o));
	}

}

import java.util.Scanner;

public class Dencker {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		boolean[] check = new boolean[101];
		int nums = scan.nextInt();
		int mex = scan.nextInt();

		for (int i=0; i<nums; i++) {
			check[scan.nextInt()] = true;
		}

		int ans = 0;
		for (int i=0; i<mex; i++) {
			if (!check[i]) ans++;
		}
		if (check[mex]) ans++;
		System.out.println(ans);
	}

}

import java.util.Scanner;

public class CodeForces450A {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in) ;
		int num = scan.nextInt();
		int mex = scan.nextInt();
		boolean[] checker = new boolean[101];
		for (int i=0; i<num; i++) {
			checker[scan.nextInt()] = true;
		}
		int ans = 0;
		for (int i=0; i<mex; i++) {
			if (!checker[i]) ans++;
		}
		if (checker[mex]) ans++;
		System.out.println(ans);
	}

}

import java.util.Scanner;

public class CodeForces435AAlt {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in) ;
		int num = scan.nextInt();
		int mex = scan.nextInt();
		int ans = 0;
		for (int i=0; i<num; i++) {
			int input = scan.nextInt();
			if (input < mex) {
				ans++;
			}
			if (input == mex) {
				ans--;
			}
		}
		System.out.println(mex-ans);
	}

}

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;

public class a_435 {
    static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }

    public static void main(String[] args) throws IOException
    {
        Reader s=new Reader();
        int n=s.nextInt();
        int q=s.nextInt();
        int a[]=new int[n];
        int d=0;
        int e=0;
        for(int i=0;i<n;i++)
        {
            a[i]=s.nextInt();
        }
        for(int i=0;i<n;i++)
        {
            if(a[i]<q)
                d++;
            else if(a[i]==q)
                e++;
        }
        int t=e+q-d;
        System.out.println(t);
    }

}

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;

public class a_435 {
    static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }

    public static void main(String[] args) throws IOException
    {
        Reader s=new Reader();
        int n=s.nextInt();
int a=s.nextInt();
int q=a;
int z;
for(int i=0;i<n;i++)
{z=s.nextInt();
if(z<a)
{
q--;
}
else if(z==a)q++;}
int ans=q;
System.out.println(ans);

    }

}

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int test_cases = 1;
        Solver s = new Solver();
        for (int i = 1; i <= test_cases; i++) {
            s.solve(i, in, out);
        }
        out.close();
    }
}
class Solver {
    boolean[][] xx = new boolean[550][550];
    void solve(int test_number, InputReader in, PrintWriter out) throws IOException {
        int n = in.nextInt();
        int k = in.nextInt();
        TreeSet<Integer> s = new TreeSet<>();
        for (int i = 0; i < n; i++) {
            s.add(in.nextInt());
        }
        int ans = 0;
        for (int i = 0; i < k; i++) {
            if (s.contains(i)) continue;
            ans++;
        }
        if (s.contains(k)) ans++;
        out.print(ans);
    }
}

class InputReader {
    BufferedReader br;
    StringTokenizer st;

    public InputReader()
    {
        br = new BufferedReader(new
                InputStreamReader(System.in));
    }

    String next()
    {
        while (st == null || !st.hasMoreElements())
        {
            try
            {
                st = new StringTokenizer(br.readLine());
            }
            catch (IOException  e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt()
    {
        return Integer.parseInt(next());
    }

    long nextLong()
    {
        return Long.parseLong(next());
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String nextLine()
    {
        String str = "";
        try
        {
            str = br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class MaximumCost {
	static boolean[][] visited;

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			return str;
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {

			return Long.parseLong(next());
		}
	}

	public static void main(String[] args) {
		FastReader sc = new FastReader();
		int n = sc.nextInt();
		int x = sc.nextInt();
		int[] set = new int[101];
		for(int i=0;i<n;i++)
			set[sc.nextInt()] = 1;
		int count =0;
		for(int i=0;i<x;i++){
			count+=1-set[i];
		}
		count+=set[x];
		System.out.println(count);

	}

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author rishabh
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n, mex, tmex = 0;
            int[] hash = new int[101];
            Arrays.fill(hash, 0);
            n = in.nextInt();
            mex = in.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
                hash[arr[i]] = 1;
            }
            for (int i = 0; i < 101; i++) {
                if (hash[i] == 0) {
                    tmex = i;
                    break;
                }
            }
            if (mex == tmex) {
                out.print(0);
            } else {
                if (hash[mex] == 1) {
                    int ans = 1;
                    for (int i = 0; i < mex; i++) {
                        if (hash[i] == 0) {
                            ans++;
                        }
                    }
                    out.print(ans);
                } else {
                    int ans = 0;
                    Arrays.sort(arr);
                    if (mex > arr[n - 1]) {
                        for (int i = 0; i < mex; i++) {
                            if (hash[i] == 0) {
                                ans++;
                            }
                        }
                    } else {
                        for (int i = 0; i < mex; i++) {
                            if (hash[i] == 0) {
                                ans++;
                            }
                        }
                    }
                    out.print(ans);
                }
            }
        }

    }
}

import java.util.*;
import java.io.*;
import java.math.BigInteger;

public class tr0 {
	static PrintWriter out;
	static StringBuilder sb;
	static int mod = (int) 1e9 + 7;
	static int inf = (int) 1e8;
	static long[] val;
	static int n, q, k;
	static int[] ad;
	static int[] ans;
	static long[] memo;
	static ArrayList<Integer> h;
	static char[][] grid;
	static int[] t, deg;
	static boolean vis[];

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n=sc.nextInt();
		int x=sc.nextInt();
		int ans=0;
		int less=0;
		int ex=0;
		for(int i=0;i<n;i++) {
		int ss=sc.nextInt();
			if(ss<x)
				less++;
		 if(ss==x)
			 ex++;
		}
		out.print(x-less+ex);
		out.flush();
	}
	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public int[] nextArrInt(int n) throws IOException {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long[] nextArrLong(int n) throws IOException {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}

import java.util.Scanner;
import java.util.HashSet;
public final class ProblemA {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int x = in.nextInt();
        HashSet<Integer> set = new HashSet<>();
        for (int i = 0; i < n; i++) {
            set.add(in.nextInt());
        }

        int opCount = 0;
        for (int i = 0; i < x; i++) {
            if (!set.contains(i)) {
                opCount++;
            }
        }
        if (set.contains(x)) {
            opCount++;
        }
        System.out.println(opCount);
    }

}

import java.util.HashMap;
import java.util.Scanner;

/**
 * Created by margulan on 10/4/17.
 */
public class cf {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        HashMap<Integer,Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            int tmp = sc.nextInt();
            map.put(tmp,0);
        }
        int res = 0;
        for (int i = 0; i < x; i++){
            if(!map.containsKey(i)){
                res++;
            }
        }
        if(map.containsKey(x)) res++;
        System.out.println(res);
    }
}

import java.util.Scanner;

public class Driver {

	public static Scanner scanner;
	public static void main(String[] args) {
		scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		int x = scanner.nextInt();
		int res = x;
		for(int i=0; i<n; i++) {
			int a = scanner.nextInt();
			if(a == x)
				res++;
			if(a < x)
				res--;
		}

		System.out.println(res);

	}
}

import java.util.Arrays;
import java.util.Scanner;

public class Arpa {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
		int n=s.nextInt();
		int req=s.nextInt();
		int[] arr=new int[n];
		for(int i=0;i<n;i++){
			arr[i]=s.nextInt();
		}
		Arrays.sort(arr);
		int max=arr[arr.length-1];
		int count=0;
		int[] arrchk=new int[101];
		for(int i=0;i<=100;i++)
			arrchk[i]=i;
		for(int i=0;i<=req;i++){
			if(Arrays.binarySearch(arr,arrchk[i])>-1&&arrchk[i]!=req){
				continue;
			}
			else if(Arrays.binarySearch(arr,arrchk[i])>-1&&arrchk[i]==req){
				count++;
			}
			else if(Arrays.binarySearch(arr,arrchk[i])<0&&arrchk[i]==req)
				continue;
			else if(Arrays.binarySearch(arr,arrchk[i])<0&&arrchk[i]!=req)
				count++;
		}
		System.out.println(count);

	}

}

import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        int n, x, num, mex = -1, req;
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        x = sc.nextInt();
        int[] a = new int[n];

        boolean[] array = new boolean[101];
        Arrays.fill(array, false);

        for(int i = 0; i < n; i++){
            num = sc.nextInt();
            array[num] = true;
        }
        int len = array.length;

        for(int i = 0; i < len; i++){
            if(array[i] == false){
                mex = i;
                break;
            }
        }

        if(mex == x){
            req = 0;
        }
        else if(mex > x){
            req = 1;
        }
        else{
            int count = 0;
            for(int i = mex; i < x; i++){
                if(array[i] == false){
                    count ++;
                }
            }
            if(array[x] == true){
                count ++;
            }
            req = count;
        }

        System.out.println(req);
    }

}

import java.util.*;
public class MyClass {

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int x = scan.nextInt();
        scan.nextLine();
        String str = scan.nextLine();
        str = " " + str + " ";
        int move = 0;
        int i = 0;

        while(i < x)
        {
            if(str.indexOf(" " + i + " ") < 0)
                move++;
            i++;
        }

        if(str.indexOf(" " + i + " ") >= 0)
                move++;

        System.out.println(move);
    }
}

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int x = scanner.nextInt();
        int arr[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }
        Arrays.sort(arr);
        int mex = -1;
        for (int i = 0; i < n; i++) {
            if (i != arr[i]) {
                mex = i;
                break;
            }
        }
        if (mex == -1){
            mex = arr[n - 1] + 1;
        }
        int test_arr[] = new int [101];
        Arrays.fill(test_arr,0);
        for (int i = 0; i < n; i++) {
            test_arr[arr[i]]++;
        }
        int sum = 0;
        for (int i = 0; i < x  ; i++) {
            sum += test_arr[i];

        }
        if (mex > x){
            System.out.println(1);
        }else if (mex == x){
            System.out.println(0);
        }else if (test_arr[x] == 1){
            System.out.println(x - sum + 1);
        }else{
            System.out.println(x - sum);
        }
    }
}

  import java.awt.Checkbox;
import java.awt.Point;
import java.io.*;
                    import java.math.*;
                    import java.util.*;
import java.util.Map.Entry;

import javax.print.attribute.SetOfIntegerSyntax;
import javax.swing.plaf.FontUIResource;

                    public class CODE2{
                      private static InputStream stream;
                        private static byte[] buf = new byte[1024];
                        private static int curChar;
                        private static int numChars;
                        private static SpaceCharFilter filter;
                        private static PrintWriter pw;
                        private static long count = 0,mod=1000000007;
                    //    private static TreeSet<Integer> ts=new TreeSet[200000];
public final static int INF = (int) 1E9;

public static void main(String args[]) {
    InputReader(System.in);
    pw = new PrintWriter(System.out);
    new Thread(null ,new Runnable(){
       public void run(){
           try{
               solve();

               pw.close();
           } catch(Exception e){
               e.printStackTrace();
           }
       }
   },"1",1<<26).start();
   }
    static StringBuilder sb;
    public static void test(){
         sb=new StringBuilder();
        int t=nextInt();
        while(t-->0){

            solve();

        }
        pw.println(sb);
    }
    public static long pow(long n, long p,long mod) {
        if(p==0)
            return 1;
        if(p==1)
            return n%mod;
        if(p%2==0){
            long temp=pow(n, p/2,mod);
        return (temp*temp)%mod;
        }else{
                 long temp=pow(n,p/2,mod);
                 temp=(temp*temp)%mod;
                 return(temp*n)%mod;

        }
    }
    public static long pow(long n, long p) {
        if(p==0)
            return 1;
        if(p==1)
            return n;
        if(p%2==0){
            long temp=pow(n, p/2);
        return (temp*temp);
        }else{
                 long temp=pow(n,p/2);
                 temp=(temp*temp);
                 return(temp*n);

        }
    }
    public static void Merge(long a[],int p,int r){
        if(p<r){
            int q = (p+r)/2;
            Merge(a,p,q);
            Merge(a,q+1,r);
            Merge_Array(a,p,q,r);
        }
    }
    public static void Merge_Array(long a[],int p,int q,int r){
       long b[] = new long[q-p+1];
        long c[] = new long[r-q];
        for(int i=0;i<b.length;i++)
            b[i] = a[p+i];
        for(int i=0;i<c.length;i++)
            c[i] = a[q+i+1];
        int i = 0,j = 0;
        for(int k=p;k<=r;k++){
            if(i==b.length){
                a[k] = c[j];
                j++;
            }
            else if(j==c.length){
                a[k] = b[i];
                i++;
            }
            else if(b[i]<c[j]){
                a[k] = b[i];
                i++;
            }
            else{
                a[k] = c[j];
                j++;
            }
        }
    }

    public static long gcd(long x, long y) {
        if (x == 0)
            return y;
        else
            return gcd( y % x,x);
    }

    public static boolean isPrime(int n) {
        if (n <= 1)
            return false;
        if (n <= 3)
            return true;

        if (n % 2 == 0 || n % 3 == 0)
            return false;

        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
                return false;

        return true;
    }

        static LinkedList<Integer> adj[];
        static boolean Visited[];
        static HashSet<Integer> exc;
        static long oddsum[]=new long[1000001];
        static long co=0,ans=0;

        private static void buildgraph(int n){
            adj=new LinkedList[n+1];
            Visited=new boolean[n+1];
            levl=new int[n+1];

            for(int i=0;i<=n;i++){
                adj[i]=new LinkedList<Integer>();

            }

        }

        static int[] levl;
        static int[] eat;
        static int n,m;
        static int price[];
        //ind frog crab

        public static void solve(){

        	int n=nextInt();
        	int x=nextInt();
        	int a[]=nextIntArray(n);
        	int freq[]=new int[x];
        	int cnt=0;
        	for(int i=0;i<n;i++){
        		if(a[i]<x){
        			freq[a[i]]++;
        		}
        		if(a[i]==x)
        			cnt++;
        	}
        	for(int i=0;i<x;i++){
        		if(freq[i]==0){
        			cnt++;
        		}
        	}
        	pw.println(cnt);
    }

        static int col[];
    public static boolean isVowel(char c){
        if(c=='a' || c=='e'||c=='i' || c=='o' || c=='u')
            return true;
        return false;
    }
static int no_vert=0;

  private static void dfs(int start){
      Visited[start]=true;
     no_vert++;

      for(int i:adj[start]){
          if(!Visited[i])
              {
              col[i]=col[start]^1;
              dfs(i);

              }
      }

  }

    public static String reverseString(String s) {
        StringBuilder sb = new StringBuilder(s);
        sb.reverse();
        return (sb.toString());
    }

  /*
   private static void BFS(int sou){
        Queue<Integer> q=new LinkedList<Integer>();
        q.add(sou);
        Visited[sou]=true;
        levl[sou]=0;
        while(!q.isEmpty()){
            int top=q.poll();

            for(int i:adj[top]){
                //pw.println(i+" "+top);
            if(!Visited[i])
            {

                q.add(i);
                levl[i]=levl[top]+1;
            }

            Visited[i]=true;

            }
        }
    }*/

                  static int indeg[];
               /* private static void kahn(int n){

                    PriorityQueue<Integer> q=new PriorityQueue<Integer>();
                    for(int i=1;i<=n;i++){
                        if(indeg[i]==0){
                            q.add(i);
                        }
                    }
                    while(!q.isEmpty()){
                        int top=q.poll();
                        st.push(top);
                        for(Node i:adj[top]){
                            indeg[i.to]--;
                            if(indeg[i.to]==0){
                                q.add(i.to);
                            }
                        }
                    }
                }

                    static int state=1;
                    static long no_exc=0,no_vert=0;
                  static Stack<Integer> st;
                  static HashSet<Integer> inset;
                 /*   private static void topo(int curr){

                        Visited[curr]=true;
                        inset.add(curr);
                        for(int x:adj[curr]){
                            if(adj[x].contains(curr) || inset.contains(x)){
                                state=0;
                                return;
                            }
                            if(state==0)
                                return;

                        }
                        st.push(curr);

                        inset.remove(curr);
                    }*/
                    static HashSet<Integer> hs;

                     static boolean prime[];
                    static int spf[];
                    public static void sieve(int n){
                        prime=new boolean[n+1];
                        spf=new int[n+1];

                        Arrays.fill(spf, 1);
                        Arrays.fill(prime, true);
                    prime[1]=false;
                        spf[2]=2;

                    for(int i=4;i<=n;i+=2){
                        spf[i]=2;
                    }
                    for(int i=3;i<=n;i+=2){
                        if(prime[i]){
                            spf[i]=i;
                            for(int j=2*i;j<=n;j+=i){

                                prime[j]=false;
                            if(spf[j]==1){
                                spf[j]=i;
                            }
                            }
                        }
                    }

                    }

                    // To Get Input
// Some Buffer Methods

                     public static void sort(long a[]){
                         Merge(a, 0, a.length-1);
                     }
                    public static void InputReader(InputStream stream1) {
                        stream = stream1;
                    }

                    private static boolean isWhitespace(int c) {
                        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
                    }

                    private static boolean isEndOfLine(int c) {
                        return c == '\n' || c == '\r' || c == -1;
                    }

                    private static int read() {
                        if (numChars == -1)
                            throw new InputMismatchException();
                        if (curChar >= numChars) {
                            curChar = 0;
                            try {
                                numChars = stream.read(buf);
                            } catch (IOException e) {
                                throw new InputMismatchException();
                            }
                            if (numChars <= 0)
                                return -1;
                        }
                        return buf[curChar++];
                    }

                    private static int nextInt() {
                        int c = read();
                        while (isSpaceChar(c))
                            c = read();
                        int sgn = 1;
                        if (c == '-') {
        sgn = -1;
        c = read();
    }
    int res = 0;
    do {
        if (c < '0' || c > '9')
            throw new InputMismatchException();
        res *= 10;
        res += c - '0';
                            c = read();
                        } while (!isSpaceChar(c));
                        return res * sgn;
                    }

                    private static long nextLong() {
                        int c = read();
                        while (isSpaceChar(c))
                            c = read();
                        int sgn = 1;
                        if (c == '-') {
        sgn = -1;
        c = read();
    }
    long res = 0;
    do {
        if (c < '0' || c > '9')
            throw new InputMismatchException();
        res *= 10;
        res += c - '0';
                            c = read();
                        } while (!isSpaceChar(c));
                        return res * sgn;
                    }

                    private static String nextToken() {
                        int c = read();
                        while (isSpaceChar(c))
                            c = read();
                        StringBuilder res = new StringBuilder();
                        do {
                            res.appendCodePoint(c);
                            c = read();
                        } while (!isSpaceChar(c));
                        return res.toString();
                    }

                    private static String nextLine() {
                        int c = read();
                        while (isSpaceChar(c))
                            c = read();
                        StringBuilder res = new StringBuilder();
                        do {
                            res.appendCodePoint(c);
                            c = read();
                        } while (!isEndOfLine(c));
                        return res.toString();
                    }

                    private static int[] nextIntArray(int n) {
                        int[] arr = new int[n];
                        for (int i = 0; i < n; i++) {
                            arr[i] = nextInt();
                        }
                        return arr;
                    }

                    private static long[][] next2dArray(int n, int m) {
                        long[][] arr = new long[n][m];
                        for (int i = 0; i < n; i++) {
                            for (int j = 0; j < m; j++) {
                                arr[i][j] = nextLong();
                            }
                        }
                        return arr;
                    }
                    private static char[][] nextCharArray(int n,int m){
                        char [][]c=new char[n][m];
                        for(int i=0;i<n;i++){
                            String s=nextLine();
                            for(int j=0;j<s.length();j++){
                                c[i][j]=s.charAt(j);
                            }
                        }
                        return c;
                    }

                    private static long[] nextLongArray(int n) {
                        long[] arr = new long[n];
                        for (int i = 0; i < n; i++) {
                            arr[i] = nextLong();
                        }
                        return arr;
                    }

                    private static void pArray(int[] arr) {
                        for (int i = 0; i < arr.length; i++) {
                            pw.print(arr[i] + " ");
                        }
                        pw.println();
                        return;
                    }

                    private static void pArray(long[] arr) {
                        for (int i = 0; i < arr.length; i++) {
                            pw.print(arr[i] + " ");
                        }
                        pw.println();
                        return;
                    }

                    private static void pArray(boolean[] arr) {
                        for (int i = 0; i < arr.length; i++) {
                            pw.print(arr[i] + " ");
                        }
                        pw.println();
                        return;
                    }

                    private static boolean isSpaceChar(int c) {
                        if (filter != null)
                            return filter.isSpaceChar(c);
                        return isWhitespace(c);
                    }

                    private interface SpaceCharFilter {
                        public boolean isSpaceChar(int ch);
                    }

}

// 20.09.2017
//

/*
������������ ����� �� ����� 4, 2, 7, 12
*/

import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class Sample03_01
{
    public static final int K = 126;
    public static long Pow2 (int b, int k)   // b^k
    {
        long res = b;
        for ( int i=1; i < k; i++ )
            res *= b;
        return res;
    }
    public static void Sorting (int f [], int n)
    {
        for ( int i=0; i < n; i++ )
            for ( int j=0; j < n-1-i; j++ )
                if ( f [j] > f [j+1] )
                {
                    int x = f [j]; f [j] = f [j+1]; f [j+1] = x;
                }
    }
    long gcd (long a, long b)
    {
        long r;
        while ( b != 0 )
        {
            r = a % b;
            a = b;
            b = r;
        }
        return a;
    }
    public static void main (String [] param)
    {
        boolean oj = System.getProperty ("ONLINE_JUDGE") != null;
        Scanner in = new Scanner (System.in);
        PrintWriter out = new PrintWriter (System.out);
        FileReader reader;
        Writer writer;

        if ( ! oj )
        {
            try
            {
                reader = new FileReader ("C:\\TRR\\2017\\Task\\07 Codeforces\\026\\A.TXT");
                in = new Scanner (reader);
            }
            catch (IOException ex)
            {
                System.out.println (ex.getMessage());
            }

            try
            {
                writer = new FileWriter ("C:\\TRR\\2017\\Task\\07 Codeforces\\026\\A.OUT", false);
                out = new PrintWriter (writer);
            }
            catch (IOException ex)
            {
                System.out.println (ex.getMessage());
            }
        }

        int n = in.nextInt ();
        int x = in.nextInt ();
        int [] a = new int [n];
        int [] mask = new int [K];
        for ( int i=0; i < K; i++ )
            mask [i] = 0;
        for ( int i=0; i < n; i++ )
        {
            a [i] = in.nextInt ();
            mask [a [i]] = 1;
        }

        if ( ! oj )
        {
            out.println ("n = " + n + " x = " + x);
            for ( int i=0; i < n; i++ )
                out.print (a [i] + " ");
            out.println ();
        }
/*
        Sorting (a, n);
        int mex = n, nmex = n;
        for ( int i=0; i < n; i++ )
            if ( a [i] != i )
            {
                mex = i;
                nmex = i;
                break;
            }

        if ( ! oj )
        {
            out.println ("mex = " + mex + " nmex = " + nmex);
        }

        int k = 0;
        if ( a [0] == 0 && x == 0 )
            k = 1;
        else if ( mex == x )
        {
            k = 0;
            if ( nmex >= n )
                k++;
        }
        else if ( mex < x )
        {
            int kol = 0;
            for ( int l=mex; l < n; l++ )
                if ( a [l] < x )
                    kol++;
            k = x - mex - kol;
        }
        else
        {
            k = mex - x;
            if ( nmex >= n )
                k++;
        }
*/
        int k = 0;
        for ( int i=0; i <= x; i++ )
            if ( i == x )
            {
                if ( k > 0 )
                {
                    if ( mask [i] == 1 )
                        k++;
                    break;
                }
                if ( mask [i] == 0 )
                    k = 0;
                else
                    k = 1;
                break;
            }
            else if ( mask [i] == 0 )
                k++;

        out.println (k);

        out.flush();
    }
}

import java.io.*;
import java.lang.reflect.Array;
import java.nio.Buffer;
import java.util.*;

public class Pair {

    static class FastReader {
        private BufferedReader br;
        private StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String[] args) throws Exception {
        try {
            FastReader sc = new FastReader();
            int n = sc.nextInt();
            int x = sc.nextInt();
            int res=x;
            for(int i=0;i<n;i++){
                int a = sc.nextInt();
                if(a==x){
                    res++;
                }
                if(a<x){
                    res--;
                }
            }
            System.out.println(res);
        }
        catch (Exception e) {
        }
    }
}

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.*;
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;

public class Main
{
    static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }

    public static void main(String[] args) throws IOException{
        //Reader in = new Reader();
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int x = in.nextInt();
        int a[] = new int[101];
        int o = 0;
        for(int i=0; i<n; i++)
        	a[in.nextInt()]++;
        for(int i=0; i<x; i++){
        	if(a[i]!=1){
        		o++;
        	}
        }
    	System.out.println(o+a[x]);
    }
}

import java.util.Arrays;
import java.util.Scanner;

public class cf {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int k = in.nextInt();

		int tab[] = new int[110];

		for (int i = 0; i < n; i++) {
			tab[in.nextInt()] = 1;

		}

		int res =0;
		if(tab[k] == 1) {
			res++;
		}
		for (int i = 0; i < k; i++) {
			if(tab[i] == 0)
				res++;
		}
		System.out.println(res);
	}

}

import java.util.Scanner;

public class MainActivity {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt(), x = scanner.nextInt();

		int operations = x;

		for (int i = 0, m = 0; i < n; i++) {
			m = scanner.nextInt();

			if (m == x) operations++;

			if (m < x)
				operations--;
		}

		System.out.println(operations);
	}
}

import java.util.Arrays;
import java.util.Scanner;

public class A {
public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int n = scan.nextInt();
	int req = scan.nextInt();
	int[] arr = new int[n];
	int MEX = -1;
	for(int i= 0 ;i<arr.length;i++)
	{
		arr[i] = scan.nextInt();
	}
	boolean[] flags = new boolean[req+1];
	for(int i = 0 ;i<flags.length;i++)
	{
		for(int k = 0;k<arr.length;k++)
		{
			if(i==arr[k]){
				flags[i] = true;
				break;
			}
		}
	}
	int c = 0;
	for(int i = 0;i<flags.length-1;i++)
	{
		if(!flags[i])
			c++;
	}
	System.out.println(flags[req]?++c:c);

}
}

import java.util.*;
public class Main
{
    public static void main(String args[] )
    {
        //Scanner
        Scanner in = new Scanner(System.in);
        int n =in.nextInt();
        int k=in.nextInt();
        int [] arr = new int[n];
        int [] freq= new int[102];
        for(int i=0;i<n;i++){
            arr[i]=in.nextInt();
             freq[arr[i]]++;
        }
        //Arrays.sort(arr);
        int count=0;
        for(int i=0;i<=k;i++){
            if(i==k && freq[i]==1){
                count++;
            }
            else if(freq[i]==0 && i!=k){
                count++;
            }
        }
        System.out.println(count);

    }
}

import java.io.*;
import java.util.*;
import java.lang.*;
import static java.lang.System.*;

public class A
{
	public static void main (String args[])throws Exception
	{
		Scanner sc=new Scanner(in);
		int n=sc.nextInt();
		int x=sc.nextInt();
		int arr[]=new int[101];

for(int i=0;i<101;i++)
arr[i]=0;
		for(int i=0;i<n;i++)
		{
			int a=sc.nextInt();

		arr[a]++;
	}

		int count=0;

		for(int i=x-1;i>=0;i--)
		{
       if(arr[i]==0)
         count++;
		}
        count+=arr[x];
		out.println(count);

	}
}

class Voucher{
	int a,b;
	public Voucher(int x,int y)
	{
		a=x;
		b=y;
	}
}
class ChComparator implements Comparator<Voucher>
{
	public int compare(Voucher v1,Voucher v2)
	{
		if(v1.b==v2.b)
		return 0;
		if(v1.b>v2.b)
		return 1;
		else
		return -1;
	}
}

/**
 * @(#)sad2.java
 *
 *
 * @author
 * @version 1.00 2017/12/3
 */

import java.util.*;

public class sad2{

	public static void main(String[] args){
    	int n, x, k, t, e;
    	t = 0;
    	e = 0;
		Scanner kbd = new Scanner(System.in);
        n = kbd.nextInt();
        x = kbd.nextInt();
        for (int i = 0; i < n; i++){
           	k = kbd.nextInt();
           	if (k<x)
         	t++;
         	if (k==x)
            e++;
        }
        System.out.printf("%d\n", x - t + e);
    }
}

import java.util.Scanner;

public class Task_292A {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), x = sc.nextInt();
		int a[] = new int [n + 1];
		int cnt[] = new int [1001];
		for(int i = 1; i <= n; i ++)
			a[i] = sc.nextInt();
		for(int i = 1; i <= n; i ++) {
			cnt[a[i]] ++;
		}
		int t = 0;
		for(int i = 0; i < x; i ++) {
			if(cnt[i] == 0) {
				t ++;
			}
		}
		if(cnt[x] > 0)
			t ++;
        System.out.println(t);
	}
}

import java.util.Arrays;
import java.util.Scanner;

public class test {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int x = in.nextInt();
		int[] arr = new int[n];

		for(int i = 0; i < n; i++)
		{
			arr[i] = in.nextInt();
		}
		Arrays.sort(arr);
		int i;
		for(i =  0; i < n && arr[i] < x ; i++)
		{

		}
		if( i < n)
		{
			if(arr[i] == x)
			{
				System.out.println(x - i + 1);
			}
			else
			{
				System.out.println(x - i);
			}

		}
		else
		{
			System.out.println(x - n);
		}

		in.close();

	}

}

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package codeforces;
import java.util.*;
/**
 *
 * @author Ashraf
 */
public class DVA1 {
    public static void main(String []args){
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int x=in.nextInt();
        int ara[]=new int[1000];
        int count=0;
        boolean bool[]=new boolean[1000];
        for(int i=1;i<=n;i++){
            ara[i]=in.nextInt();
            bool[ara[i]]=true;
        }
        for(int i=0;i<x;i++){
            if(bool[i]==false){
                ++count;
            }
        }
        if(bool[x]==true) ++count;
        System.out.println(count);
    }
}

import java.util.*;
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb=new Scanner(System.in);
		while(kb.hasNext()){
			int n=kb.nextInt();
			int m=kb.nextInt();
			int a[]=new int[n];
			for (int i = 0; i < a.length; i++) {
				a[i]=kb.nextInt();
			}
			Arrays.sort(a);
			int ans=m;
			for (int i = 0; i < a.length; i++) {

				if(a[i]<m){
					ans--;
				}else if(a[i]==m){
					ans++;
				}
			}
			System.out.println(ans);
		}
	}

}

import java.util.*;
import java.io.*;
public class a {
	public static void main(String[] arg) {
		new a();
	}
	public a() {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int x = in.nextInt();
		int ret = 0;
		HashSet<Integer> hs = new HashSet<Integer>();
		for(int i = 0; i < n; i++) {
			int v = in.nextInt();
			if(v == x) ret++;
			if(v < x) hs.add(v);
		}
		System.out.println(ret+(x-hs.size()));
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (PloadyFree@gmail.com)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            int x = in.readInt();
            int[] count = new int[102];
            for (int i = 0; i < n; i++) {
                count[in.readInt()]++;
            }
            int ans = count[x];
            for (int i = x - 1; i >= 0; i--) {
                if (count[i] == 0) {
                    ans++;
                }
            }
            out.print(ans);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void print(int i) {
            writer.print(i);
        }

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;

/**
 * Created by sadhman on 19-09-2017.
 */
public class Test {

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int n = in.nextInt();
        int x = in.nextInt();
        int[] a= new int[n];
        int max=-1;
        for (int i = 0; i <n ; i++) {
            a[i]=in.nextInt();
            if(a[i]>max)max=a[i];
        }
        int[] hash= new int[100000];
        Arrays.fill(hash,0);
        for (int i = 0; i <n ; i++) {
            hash[a[i]]=1;
        }
        int count=0;
        for (int i = x-1; i >=0 ; i--) {
            if(hash[i]==0)
                count++;
        }
        if(hash[x]==1)
        System.out.println(count+1);
        else
            System.out.println(count);
    }
     static class InputReader
    {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public int read()
        {
            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars)
            {
                curChar = 0;
                try
                {
                    numChars = stream.read(buf);
                }
                catch (IOException e)
                {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }

            return buf[curChar++];
        }

        public int nextInt()
        {
            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-')
            {
                sgn = -1;
                c = read();
            }

            int res = 0;

            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                res *= 10;
                res += c & 15;

                c = read();
            } while (!isSpaceChar(c));

            return res * sgn;
        }

        public int[] nextIntArray(int arraySize)
        {
            int array[] = new int[arraySize];

            for (int i = 0; i < arraySize; i++)
                array[i] = nextInt();

            return array;
        }

        public long nextLong()
        {
            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sign = 1;

            if (c == '-')
            {
                sign = -1;

                c = read();
            }

            long result = 0;

            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                result *= 10;
                result += c & 15;

                c = read();
            } while (!isSpaceChar(c));

            return result * sign;
        }

        public long[] nextLongArray(int arraySize)
        {
            long array[] = new long[arraySize];

            for (int i = 0; i < arraySize; i++)
                array[i] = nextLong();

            return array;
        }

        public float nextFloat()
        {
            float result, div;
            byte c;

            result = 0;
            div = 1;
            c = (byte) read();

            while (c <= ' ')
                c = (byte) read();

            boolean isNegative = (c == '-');

            if (isNegative)
                c = (byte) read();

            do
            {
                result = result * 10 + c - '0';
            } while ((c = (byte) read()) >= '0' && c <= '9');

            if (c == '.')
                while ((c = (byte) read()) >= '0' && c <= '9')
                    result += (c - '0') / (div *= 10);

            if (isNegative)
                return -result;

            return result;
        }

        public double nextDouble()
        {
            double ret = 0, div = 1;
            byte c = (byte) read();

            while (c <= ' ')
                c = (byte) read();

            boolean neg = (c == '-');

            if (neg)
                c = (byte) read();

            do
            {
                ret = ret * 10 + c - '0';
            } while ((c = (byte) read()) >= '0' && c <= '9');

            if (c == '.')
                while ((c = (byte) read()) >= '0' && c <= '9')
                    ret += (c - '0') / (div *= 10);

            if (neg)
                return -ret;

            return ret;
        }

        public String next()
        {
            int c = read();

            while (isSpaceChar(c))
                c = read();

            StringBuilder res = new StringBuilder();

            do
            {
                res.appendCodePoint(c);

                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        public boolean isSpaceChar(int c)
        {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String nextLine()
        {
            int c = read();

            StringBuilder result = new StringBuilder();

            do
            {
                result.appendCodePoint(c);

                c = read();
            } while (!isNewLine(c));

            return result.toString();
        }

        public boolean isNewLine(int c)
        {
            return c == '\n';
        }

        public void close()
        {
            try
            {
                stream.close();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
        }

        public InputReader(InputStream stream)
        {
            this.stream = stream;
        }

    }
}

/*

1
5 4
1 2
1 3
3 4
5 1

1
5 5
1 2
1 3
3 4
5 1
5 3

*/

import java.util.*;

public class MEXevil{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), x = sc.nextInt();
        TreeSet<Integer> ts = new TreeSet();
        for(int i = 0; i < n; i++){
            ts.add(sc.nextInt());
        }
        int cnt = 0;
        for(int i = 0; i < x; i++){
            if(!ts.contains(i)) cnt++;
        }
        if(ts.contains(x)) cnt++;
        System.out.println(cnt);
    }
}

import java.util.*;
public class One {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int ar[] = new int[n];
        for (int i = 0; i < n; i++){
            ar[i] = sc.nextInt();
        }
        int count = 0;
        for (int i = 0 ; i < n; i++){
            if (ar[i] < x) count++;
            if (ar[i] == x) count--;
        }
        System.out.println(x - count);
    }

}

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int[] arr= new int[n*2];
        for (int i = 0; i < n*2; i++) {
            if(i<n) {
                arr[i] = sc.nextInt();
            }else{
                arr[i]=101;
            }
        }
        Arrays.sort(arr);
        int count = 0;
        int ind=0;
        for (int i = 0; i <= x; i++) {
            if(arr[ind]==i&&arr[ind]!=x){
                ind++;
            }else{
                if(arr[ind]==x&&x==i){
                    count++;
                }
                if(arr[ind]!=i&&i!=x){
                    count++;
                }
            }
        }
        System.out.println(count);
    }
}

import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class A {

    public static void main(String... args) {
        PrintWriter out = new PrintWriter(System.out, false);
        InputReader reader = new InputReader(System.in);

        int n = reader.nextInt();
        int x = reader.nextInt();
        int[] set = reader.readIntArray(n);
        Arrays.sort(set);

        int i = 0, current = 0, operations = 0;
        for (; i < x && current < set.length; i++) {
            if (set[current] == i) {
                current++;
            } else operations++;
        }

        if (current >= set.length) {
            operations += (x - set[current - 1] - 1);
            out.println(operations);
        } else out.println(set[current] == x ? operations + 1: operations);

        out.flush();
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readIntArray(int n) {
            int[] a = new int[n];
             for (int idx = 0; idx < n; idx++) {
                a[idx] = nextInt();
             }
             return a;
        }

    }

}

import java.util.Arrays;
import java.util.Scanner;

public class Codechef {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt(), x = input.nextInt(), c = 0, c1 = 0;
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = input.nextInt();
        }
        Arrays.sort(a);
        for (int i = 0; i < x; i++) {
            for (int j = 0; j <n; j++) {
                if(a[j]==i){
                    c++;
                }
            }
        }
      //System.out.println(c);
        for (int i = 0; i <n; i++) {
            if(a[i]==x){
                c1++;
            }
        }
      //System.out.println(c1);
      if(c1==0){
          System.out.println(x-c);
      }else{
          System.out.println(x-c+c1);
      }

        /*for (int i = 0; i < n; i++) {
            System.out.println(a[i]);
        }*/

    }

}

import java.util.*;
import java.math.*;
public class CodeForces {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int x=sc.nextInt();
        int arr[]=new int[n];
        for(int i=0;i<n;i++)
            arr[i]=sc.nextInt();
        Arrays.sort(arr);
        int count=0;
        int count1=0;
        for(int i=0;i<n;i++)
        {
            if(arr[i]<x)
                ++count;
            if(arr[i]==x)
                ++count1;
        }
        System.out.println(x-count+count1);
    }

}

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Mex {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt(), res = 0;
        int x = scanner.nextInt();
        ArrayList <Integer> a = new ArrayList<>();

        for(int i=0; i<n; i++){
            a.add(scanner.nextInt());
        }

        if(a.contains(x)) res++;
        for (int i= x-1; i>=0; i--){
            if (!(a.contains(i)))res++;
        }
        System.out.println(res);
    }
}

import java.util.Scanner;

/**
 *
 * @author iqtid
 */
public class MahmudAndEhabMax {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int x = scanner.nextInt();
        int res = x;
        for(int i=0;i<n;i++) {
            int a = scanner.nextInt();
            if(a==x) {
                res++;
            }
            if(a<x) {
                res--;
            }
        }
        System.out.println(res);
    }

}

import java.io.*;
import java.util.*;
import java.util.Map.Entry;
import java.lang.Math;
import java.math.BigInteger;

public class Problem {

	public static void main(String[] args) throws IOException {

		new Problem().run();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer tok;
	Random rnd = new Random();
	static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

	Problem() throws FileNotFoundException {

		if (ONLINE_JUDGE) {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
		} else {
			in = new BufferedReader(new FileReader("input.txt"));
			out = new PrintWriter("output.txt");
		}
		tok = new StringTokenizer("");
	}

	long INF = 1L * 1000 * 1000 * 1000 * 1000 * 100 + 100;

	int curDay = 0;
	class Exam implements Comparable<Exam>{
		int ind;
		int cost;
		Exam(int ind, int cost){
			this.cost = cost;
			this.ind = ind;
		}
		@Override
		public int compareTo(Exam other) {
			return Integer.compare(this.cost+curDay-this.ind, other.cost+curDay-other.ind)*(-1);
		}

	}
	int[] arr;
	void solve() throws IOException {
		int n = rI();
		int k = rI();
		Set<Integer> st = new HashSet<>();
		for(int i=0;i<n;++i){
			st.add(rI());
		}
		int ans=0;
		for(int i=0;i<k;++i){
			if(!st.contains(i)){
				ans++;
			}
		}
		if(st.contains(k)){
			ans++;
		}
		out.println(ans);
	}

	// ======================================================

	// ======================================================
	void run() throws IOException {
		solve();
		out.close();
	}

	char[] reverseCharArray(char[] arr) {
		char[] ans = new char[arr.length];
		for (int i = 0; i < arr.length; ++i) {
			ans[i] = arr[arr.length - i - 1];
		}
		return ans;
	}

	int sqrt(double m) {
		int l = 0;
		int r = 1000000000 + 9;
		int i = 1000;
		while (r - l > 1) {
			int mid = (r + l) / 2;
			if (mid * mid > m) {
				r = mid;
			} else {
				l = mid;
			}
		}
		return l;
	}

	int countPow(int m, int n) {
		int ans = 0;
		while (m % n == 0 && m > 0) {
			ans++;
			m /= n;
		}
		return ans;
	}

	long binPow(long a, long b) {
		if (b == 0) {
			return 1;
		}
		if (b % 2 == 1) {
			return a * binPow(a, b - 1);
		} else {
			long c = binPow(a, b / 2);
			return c * c;
		}

	}

	long gcd(long a, long b) {
		return b == 0 ? a : gcd(b, a % b);
	}

	long pow(long x, long k) {
		long ans = 1;
		for (int i = 0; i < k; ++i) {
			ans *= x;
		}
		return ans;
	}

	// ////////////////////////////////////////////////////////////////////

	String delimiter = " ";

	String readLine() throws IOException {
		return in.readLine();
	}

	String rS() throws IOException {
		while (!tok.hasMoreTokens()) {
			String nextLine = readLine();
			if (null == nextLine)
				return null;

			tok = new StringTokenizer(nextLine);
		}

		return tok.nextToken(delimiter);
	}

	int rI() throws IOException {
		return Integer.parseInt(rS());
	}

	long rL() throws IOException {
		return Long.parseLong(rS());
	}

	int[] rA(int b) {
		int a[] = new int[b];
		for (int i = 0; i < b; i++) {
			try {
				a[i] = rI();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return a;
	}

	int[] readSortedIntArray(int size) throws IOException {
		Integer[] array = new Integer[size];

		for (int index = 0; index < size; ++index) {
			array[index] = rI();
		}
		Arrays.sort(array);

		int[] sortedArray = new int[size];
		for (int index = 0; index < size; ++index) {
			sortedArray[index] = array[index];
		}

		return sortedArray;
	}

	int[] sortedIntArray(int size, int[] array) throws IOException {
		for (int index = 0; index < size; ++index) {
			array[index] = rI();
		}
		Arrays.sort(array);

		int[] sortedArray = new int[size];
		for (int index = 0; index < size; ++index) {
			sortedArray[index] = array[index];
		}

		return sortedArray;
	}
}

import java.util.*;
import java.lang.*;
import java.io.*;

public class Codechef
{

	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int x=sc.nextInt();
		int[] arr=new int[n];
		for(int i=0;i<n;i++)
		{
		arr[i]=sc.nextInt();
		}
		Arrays.sort(arr);
		int number=0;
		int operation=0;
		int i=0;
		while(number!=x && i<n)
		{
		    if(arr[i]!=number)
		    {
		        number++;
		        operation++;
		    }
		    else if(arr[i]==number)
		    {
		    i++;
		    number++;
		    }
		}
		if(i<n && number==x && arr[i]==x)
		operation++;

		if(number!=x && i==n)
		{
		    while(number!=x)
		    {
		    number++;
		    operation++;
		    }
		}
		System.out.println(operation);

	}
}

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Solution
{
    public static double eps = 1e-9;

    public static int gcd(int a, int b)
    {
        if (b == 0) return a; else
            return gcd(b, a % b);
    }

    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        int x = in.nextInt();

        int[] t = new int[n];

        for (int i = 0; i < n; i++) t[i] = in.nextInt();

        int nr = 0;
        int l = 0;

        for (int i = 0; i < n; i++)
            if (t[i] < x) nr++; else
                if (t[i] == x) l = 1;

        System.out.println(x - nr + l);
    }

    public static class Pair<T, K>
    {
        public T key1;
        public K key2;

        public Pair()
        {

        }

        public Pair(T key1, K key2)
        {
            this.key1 = key1;
            this.key2 = key2;
        }
    }
}

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        Set<Integer> set = new HashSet<>();
        int n = scanner.nextInt() , x = scanner.nextInt();

        for ( int i = 0; i < n ; i++){
            set.add(scanner.nextInt());
        }
        int i = x - 1 , count = 0;
        if (set.contains(x))
            count++;

        while(i>-1){

            if (!set.contains(i)){
                count++;
            }
            i--;

        }

        System.out.println(count);

    }
}

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        int n=input.nextInt();
        int x=input.nextInt();
        int ans=x;
        for (int i=0;i<n;i++){
            int a=input.nextInt();
            if (a==x){
                ans++;
            }
            else if (a<x){
                ans--;
            }
        }
        System.out.println(ans);

    }
}

import java.io.PrintWriter;
import java.util.*;

public class A {
    private static final int N = 110;
    private static Scanner in;
    private static PrintWriter err;
    private static PrintWriter out;

    public static void main(String[] args) {
        in = new Scanner(System.in);
        err = new PrintWriter(System.err, true);
        out = new PrintWriter(System.out, true);

        while (true) {
            try {
                solve();
                err.println("==========");
            } catch (NoSuchElementException e) {
                break;
            }
        }
        err.flush();
        out.flush();
    }

    private static void solve() {
        int n, x;
        n = in.nextInt();
        x = in.nextInt();
        Integer[] a = new Integer[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        Set<Integer> set = new HashSet<>(Arrays.asList(a));
        int res = 0;
        for (int i = 0; i < x; ++i) {
            if (!set.contains(i)) {
                res++;
            }
        }

        if (set.contains(x)) {
            res++;
        }

        out.println(res);
    }
}

import java.util.*;
public class Mahmoud_and_Ehab_and_MEX
{
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		int mex_req=in.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		for(int i=0;i<n;i++)
		{
			int a=in.nextInt();
			list.add(a);
		}
		int mex=-1;
		for(int i=0;i<101;i++)
		{
			if(list.contains(i)!=true)
			{
				mex=i;
				break;
			}
		}
//		Collections.sort(list);
//		System.out.println(list);
		if(mex>=mex_req)
		{
			if(mex==mex_req)
				System.out.println(0);
			else
				System.out.println(1);
		}
		else
		{
			int needed=0;
			if(list.contains(mex_req))
				needed++;
			for(int i=mex;i<mex_req;i++)
			{
				if(list.contains(i)!=true)
				{
					needed++;
				}
//				System.out.println(needed);
			}
			System.out.println(needed);
		}
	}
}

import java.util.*;
public class Mahmoud_and_Ehab_and_MEX
{
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		int mex_req=in.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		for(int i=0;i<n;i++)
		{
			int a=in.nextInt();
			list.add(a);
		}
		int mex=-1;
		for(int i=0;i<101;i++)
		{
			if(list.contains(i)!=true)
			{
				mex=i;
				break;
			}
		}
		Collections.sort(list);
//		System.out.println(list);
		if(mex>=mex_req)
		{
			if(mex==mex_req)
				System.out.println(0);
			else
				System.out.println(1);
		}
		else
		{
			int needed=0;
			if(list.contains(mex_req))
				needed++;
			for(int i=mex;i<mex_req;i++)
			{
				if(list.contains(i)!=true)
				{
					needed++;
				}
//				System.out.println(needed);
			}
			System.out.println(needed);
		}
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashSet;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author unknown
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        AMahmoudAndEhabAndTheMEX solver = new AMahmoudAndEhabAndTheMEX();
        solver.solve(1, in, out);
        out.close();
    }

    static class AMahmoudAndEhabAndTheMEX {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();
            int x = in.nextInt();
            HashSet<Integer> hs = new HashSet<>();
            for (int i = 0; i < n; i++) {
                hs.add(in.nextInt());
            }
            int ans = 0;
            for (int i = 0; i < x; i++) {
                if (!hs.contains(i)) {
                    ans++;
                }
            }
            if (hs.contains(x)) {
                ans++;
            }
            out.println(ans);
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void println(long i) {
            writer.println(i);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

import java.util.*;
import java.io.*;

public class aaaaaaaa {
	public void run() throws Exception {
		FastReader file = new FastReader();
		int times = file.nextInt();
		HashSet<Integer> s = new HashSet();
		int c = file.nextInt();
		for (int asdf = 0; asdf < times; asdf++) {
			s.add(file.nextInt());
		}
		int cnt = 0;
		for (int i = 0; i < c; i++) {
			if (!s.contains(i)) cnt++;
		}
		if (s.contains(c)) cnt++;
		System.out.println(cnt);
	}

	public static void main(String[] args) throws Exception {
		new aaaaaaaa().run();
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

//https://codeforces.com/problemset/problem/862/A
public class problem862A {
    public static void main(String[] args) {
        FastReader sc = new FastReader();
        PrintWriter w = new PrintWriter(System.out);
        int n= sc.nextInt();
        int m = sc.nextInt();
        int count = 0; int t=0;
        for (int i = 0; i < n; i++) {
            int x= sc.nextInt(); if(x<m || m==0&&x==0)
                count++;
            if(x==m)
                t=1;
        }
        w.print(m-count<0?1:m-count+t);
        w.close();
        w.flush();
    }
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

//https://codeforces.com/problemset/problem/862/A
public class problem862A {
    public static void main(String[] args) {
        FastReader sc = new FastReader();
        PrintWriter w = new PrintWriter(System.out);
        int n= sc.nextInt();
        int m = sc.nextInt();
        int count = 0; int t=0;
        for (int i = 0; i < n; i++) {
            int x= sc.nextInt(); if(x<m || m==0&&x==0)
                count++;
            if(x==m)
                t=1;
        }
        System.out.println(m-count<0?1:m-count+t);
    }
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

import java.util.*;
public class A862
{
    public static void main(String...arg)
    {
        int x,n,c=0,c1=0,c2=0,i,j,k;
        Scanner sc=new Scanner(System.in);
        n=sc.nextInt();
        x=sc.nextInt();
        int a[]=new int[n];
        for(i=0;i<n;i++)
        {
            a[i]=sc.nextInt();
        }
        for(i=0;i<x;i++)
        {
            c1=0;
            for(j=0;j<n;j++)
            {
                if(i==a[j])
                {
                    c1=1;
                    break;
                }
                //if(i==x&&a[i]==i)
                //c1=0;
            }
            if(c1==0)
            c++;
		//System.out.println(c+" "+i);
        }
        for(j=0;j<n;j++)
        {
            if(a[j]==x)
            {
                c++;
            }
        }
        System.out.println(c);
    }
}

import java.util.Arrays;
import java.util.Scanner;

public class searching {

	public static void main(String args[]) {

		int n,x;

		Scanner s = new Scanner(System.in);

		n=s.nextInt();
		x = s.nextInt();
		int [] a = new int[n];
		for(int i=0;i<n;i++) {
			a[i]=s.nextInt();
		}
		Arrays.sort(a);
		int count = 0,i=0;
		while(i<n && a[i]<x) {
			i++;
		}
		count = x-(i);
		if(i!=n) {
		if(a[i]==x)
			count++;
		}
		System.out.println(count);

	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class C862A {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Test solver = new Test();
		solver.solve(1, in, out);
		out.close();
	}

	static class Test {

		public void solve(int i, InputReader in, PrintWriter out) {
			int n = in.nextInt();
			int k = in.nextInt();
			int[] num = new int[n];
			int[] tb = new int[k+1];
			for (int j = 0; j < n; j++) {
				num[j] = in.nextInt();
				if(num[j]<=k) {
					tb[num[j]]++;
				}
			}
			Arrays.sort(num);
			if (num[0] > k) {
				out.println(k);
			} else {

					int count = 0;
					for (int j = 0; j < k; j++) {
						if (tb[j]==0) {
							count++;
						}
					}
					if(tb[k]!=0) {
						count+=tb[k];
					}
					out.println(count);
			}
		}
	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

	}
}

import java.util.Arrays;
import java.util.Scanner;

public class Arpa {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
		int n=s.nextInt();
		int req=s.nextInt();
		int[] arr=new int[n];
		for(int i=0;i<n;i++){
			arr[i]=s.nextInt();
		}
		Arrays.sort(arr);
		int mex=arr[0];
		int count=0;
		if(req>arr[0]){
			int temp=arr[0];
			while(temp!=req){
				if(Arrays.binarySearch(arr,temp)<0){
					count++;
				}

				temp+=1;
			}
			System.out.println(count);
		}
		else{
			if(req==arr[0])  System.out.println("1");
			else
			System.out.println("0");
		}
	}

}

import java.io.*;
import java.util.*;

public class JavaPuzzler {

    //Scanner sc;
    private FastScanner sc;
    private PrintWriter out;

    int[] nums;

    public void solve() {
        int n = sc.nextInt();
        int x = sc.nextInt();
        nums = new int[101];
        for (int i = 0; i < n; ++i) {
            ++nums[sc.nextInt()];
        }
        int cnt = 0;
        int len = Math.min(n, x);
        for (int i = 0; i <= len; ++i) {
            if (i == x) {
                if (nums[i] == 0) --cnt;
                else ++cnt;
            }
            if (nums[i] == 0) ++cnt;
        }

        out.println(cnt);
    }

    private void run() {
//        try {
//            sc = new FastScanner(new File("input.txt"));
////            out = new PrintWriter(new File("output.txt"));
//        out = new PrintWriter(System.out);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }

        sc = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();

        out.close();

    }

    public static void main(String[] args) {
        new JavaPuzzler().run();
    }

    private class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null) {
                    return null;
                }
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null) {
                    return false;
                }
                st = new StringTokenizer(s);
            }
            return true;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class A {

    public static void main(String... args) {
        PrintWriter out = new PrintWriter(System.out, false);
        InputReader reader = new InputReader(System.in);

        int n = reader.nextInt();
        int x = reader.nextInt();
        int[] set = reader.readIntArray(n);
        Arrays.sort(set);

        int i = 0, current = 0, operations = 0;
        for (; i < x && current < set.length; i++) {
            if (set[current] == i) {
                current++;
            } else operations++;
        }

        if (current >= set.length) {
            operations += (x - set[current - 1]);
            out.println(operations);
        } else out.println(set[current] == x ? operations + 1: operations);

        out.flush();
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readIntArray(int n) {
            int[] a = new int[n];
             for (int idx = 0; idx < n; idx++) {
                a[idx] = nextInt();
             }
             return a;
        }

    }

}

//package com.company;

import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    int n = sc.nextInt();
	    int x = sc.nextInt();
	    int c[] = new int[n];
	    for(int i=0;i<n;i++)
	    	c[i] = sc.nextInt();
	    Arrays.sort(c);
	    if(x<c[0]){
	    	System.out.println(0);
	    	System.exit(0);
		}
	    if(x==c[0]){
			System.out.println(1);
			System.exit(0);
		}
	    int i=0,j=i+1;
	    int count=0;
	    while(j<n && c[j]<=x){
	    	count+=c[j]-c[i]-1;
	    	j++;
	    	i++;
		}
		if(c[j]==x)
			count++;
		count+=x-c[i]-1;
		System.out.println(count);
    }
}

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int test_cases = 1;
        Solver s = new Solver();
        for (int i = 1; i <= test_cases; i++) {
            s.solve(i, in, out);
        }
        out.close();
    }
}
class Solver {
    boolean[][] xx = new boolean[550][550];
    void solve(int test_number, InputReader in, PrintWriter out) throws IOException {
        int n = in.nextInt();
        int k = in.nextInt();
        TreeSet<Integer> s = new TreeSet<>();
        for (int i = 0; i < n; i++) s.add(in.nextInt());
        out.print(findMin(s, k));
    }

    private int findMin(TreeSet<Integer> s, int k) {
        int ans = 0;
        while (true) {
            int min = 0;
            for (Integer x : s) {
                if (x == min) {
//                    System.out.println("YES");
                    min++;
                }
            }
//            System.out.println(min);
            if (min == k) return ans;
            if (min > k) {
                s.remove(min - 1);
            }
            else {
                s.add(min);
            }
//            System.out.println(s);
            ans++;
        }
    }
}

class InputReader {
    BufferedReader br;
    StringTokenizer st;

    public InputReader()
    {
        br = new BufferedReader(new
                InputStreamReader(System.in));
    }

    String next()
    {
        while (st == null || !st.hasMoreElements())
        {
            try
            {
                st = new StringTokenizer(br.readLine());
            }
            catch (IOException  e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt()
    {
        return Integer.parseInt(next());
    }

    long nextLong()
    {
        return Long.parseLong(next());
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String nextLine()
    {
        String str = "";
        try
        {
            str = br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}

import java.util.*;
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb=new Scanner(System.in);
		while(kb.hasNext()){
			int n=kb.nextInt();
			int m=kb.nextInt();
			int a[]=new int[n];
			for (int i = 0; i < a.length; i++) {
				a[i]=kb.nextInt();
			}
			Arrays.sort(a);
			for (int i = 0; i < a.length; i++) {
				if(a[i]<m){
					m--;
				}
			}
			System.out.println(m);
		}
	}

}

import java.util.Arrays;
import java.util.Scanner;

public class Mex {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int x = scanner.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextInt();
        }
        Arrays.sort(a);
        if (x < a[0]) {
            System.out.println("0");
            return;
        }
        int i = 0;
        while (a[i] < x){
            i++;
        }
        int res = a[i] - x + 1 - i;
        System.out.println(res);
    }
}

import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class R435A {

    FastScanner sc;
    PrintWriter out;

    int n;
    int X;
    int[] arr;

    static int mex(int x, int[] arr) {
        int res = 0;
        Arrays.sort(arr);

        int maxx = arr[arr.length-1];
        int minn = arr[0];

        // left
        if (x > maxx)  {
            res = maxx+1;
            return res;
        }
        // right
        if (x < minn)  {
            res = minn-1;
            return res;
        }
        // inside
        res = (x - arr[0])-1;

        /*for (int i=1; i<arr.length; i++) {
            int diff = arr[i] - arr[i-1];
            if (diff > 1) {
                res = arr[i-1]+1;
                break;
            }
        }*/

        return res;
    }

    public void solve()  {
        n = sc.nextInt();
        X = sc.nextInt();
        arr = new int[n];
        for (int i=0; i<n; i++) {
            arr[i] = sc.nextInt();
        }

        if (mex(X, arr) == X) {
            out.println(0);
            return;
        }

        if (X == 0 && arr[0] == 0) {
            System.out.println(1);
            return;
        }

        /*if (n == 1) {
            out.println(1);
            return;
        }*/

        out.println(mex(X, arr));

        //Arrays.sort(arr);

    }

    private void run() {
       //sc = new FastScanner(new File("input.txt"));
        sc = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();
        out.close();
    }

    public static void main(String[] args) {
        new R435A().run();
    }

    private class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

import java.util.Arrays;
import java.util.Scanner;

public class ArrayLesson {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int x = s.nextInt();
        Integer[] list = new Integer[n];
        for (int i = 0; i<n; i++) {
            list[i] = s.nextInt();
        }
        Arrays.sort(list);
        int res = 0;
        int prev = -1;
        for (int elem:list) {
            if (elem<x) res+=(elem-prev-1);
            else if (elem==x) res+=1;
            else {
                res+=Math.max(0, x-prev-1);
                break;
            }
            prev=elem;
        }
        if (list[n-1]<x) res+=(x-list[n-1]-1);
        System.out.println(res);
    }
}

import java.util.*;
public class Mahmoud_and_Ehab_and_MEX
{
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		int mex_req=in.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		for(int i=0;i<n;i++)
		{
			int a=in.nextInt();
			list.add(a);
		}
		int mex=-1;
		for(int i=0;i<101;i++)
		{
			if(list.contains(i)!=true)
			{
				mex=i;
				break;
			}
		}
		if(mex>=mex_req)
		{
			System.out.println(Math.abs(mex-mex_req));
		}
		else
		{
			int needed=0;
			for(int i=mex;i<mex_req;i++)
			{
				if(list.contains(i)!=true)
					needed++;
			}
			System.out.println(needed);
		}
	}
}

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int x = scanner.nextInt();
        int arr[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }
        Arrays.sort(arr);
        int mex = -1;
        for (int i = 0; i < n; i++) {
            if (i != arr[i]) {
                mex = i;
                break;
            }
        }
        if (mex == -1){
            mex = arr[n - 1] + 1;
        }
        int test_arr[] = new int [101];
        Arrays.fill(test_arr,0);
        for (int i = 0; i < n; i++) {
            test_arr[arr[i]]++;
        }
        int sum = 0;
        for (int i = 0; i < x -1 ; i++) {
            sum += test_arr[i];
        }
        if (mex > x){
            System.out.println(1);
        }else if (mex == x){
            System.out.println(0);
        }else {
            System.out.println(x - sum);
        }
    }
}

import java.util.Scanner;

public class Task_292A {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), x = sc.nextInt();
		int a[] = new int [n + 1];
		int cnt[] = new int [1001];
		for(int i = 1; i <= n; i ++)
			a[i] = sc.nextInt();
		int mn = 0;
		for(int i = 1; i <= n; i ++) {
			cnt[a[i]] ++;
		}
		int t = 0;
		for(int i = 0; i < x; i ++) {
			if(cnt[i] == 0) {
				t ++;
			}
		}
		if(t > 0) {
			System.out.println(t);
		}
		else {
			if(cnt[x] == 0)
				System.out.println(0);
			else
				System.out.println(1);
		}
	}
}

import java.util.*;

public class CF435ProblemA {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int x = sc.nextInt();
		int[] ar = new int[n];
		int count = 0;

		for (int i = 0; i < n; i++) {
			ar[i] = sc.nextInt();

		}

		Arrays.sort(ar);

		for (int i = 0; i < ar.length; i++) {
			if (i > 0) {
				if (x > ar[i-1]) {
					if (x > ar[i]) {
						// gets the number in between for example, if x > 5 but
						// ar[1] = 2 and ar[2] = 5
						count = count + (ar[i] - ar[i-1] -1);
					} else if (x < ar[i]) {
						count += (x - ar[i-1] - 1);
					} else if (x == ar[i]) {
						count += (x - ar[i-1]);
					}

				}
			} else {
				if (x == ar[i]) {
					count = x + 1;
					break;
				} if (x > ar[i]) {
					count += ar[i];
				}
			}
		}

		System.out.println(count);

		//		int mex;
		//		int last = 0;
		//		int step;
		//
		//		for (int i = 0; i < n; i++) {
		//			ar[i] = sc.nextInt();
		//			if (ar[i] != i) {
		//				mex = i;
		//				if (mex == x) {
		//					break;
		//				}
		//			}
		//			if ((ar[i] - last) > 1) {
		//				step = ar[i] - last;
		//				if (x <= step + ar[i]) {
		//
		//				}
		//			}
		//			last = ar[i];
		//		}
		//
		//		System.out.println(count);
		//

	}

}

/*
 * Author Ayub Subhaniya
 * Institute DA-IICT
 */

import java.io.*;
import java.util.*;

public class Codeforces429A
{

	InputStream in;
	PrintWriter out;

	void solve()
	{
		int n=ni();
		int x=ni();
		boolean present[]=new boolean[102];
		for (int i=0;i<n;i++)
			present[ni()]=true;
		int mex=0;
		while (present[mex])
			mex++;
		if (mex==x)
		{
			out.println(0);
		}
		else if (mex>x)
		{
			out.println(mex-x);
		}
		else
		{
			int cnt=0;
			for (int i=mex;i<x;i++)
				if (!present[i])
					cnt++;
			out.println(cnt);
		}
	}

	void run() throws Exception
	{
		String INPUT = "C:/Users/ayubs/Desktop/input.txt";
		in = oj ? System.in : new FileInputStream(INPUT);
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis() - s + "ms");

	}
	public static void main(String[] args) throws Exception
	{
		new Codeforces429A().run();
	}

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf)
		{
			ptrbuf = 0;
			try
			{
				lenbuf = in.read(inbuf);
			}
			catch (IOException e)
			{
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean inSpaceChar(int c)
	{
		return !(c >= 33 && c <= 126);
	}

	private int skip()
	{
		int b;
		while ((b = readByte()) != -1 && inSpaceChar(b))
			;
		return b;
	}

	private double nd()
	{
		return Double.parseDouble(ns());
	}

	private char nc()
	{
		return (char) skip();
	}

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(inSpaceChar(b)))
		{ // when nextLine, (inSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(inSpaceChar(b)))
		{
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-')
		{
			minus = true;
			b = readByte();
		}

		while (true)
		{
			if (b >= '0' && b <= '9')
			{
				num = num * 10 + (b - '0');
			}
			else
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-')
		{
			minus = true;
			b = readByte();
		}

		while (true)
		{
			if (b >= '0' && b <= '9')
			{
				num = num * 10 + (b - '0');
			}
			else
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

	private void tr(Object... o)
	{
		if (!oj)
			System.out.println(Arrays.deepToString(o));
	}

}

import java.io.*;
import java.lang.reflect.Array;
import java.nio.Buffer;
import java.util.*;

public class Pair {

    static class FastReader {
        private BufferedReader br;
        private StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String[] args) throws Exception {
        try {
            FastReader sc = new FastReader();
            int n = sc.nextInt();
            int x = sc.nextInt();
            int res=x;
            for(int i=0;i<n;i++){
                int a = sc.nextInt();
                if(a==x){
                    res++;
                }
                if(a<x){
                    res--;
                }
            }
        }
        catch (Exception e) {
        }
    }
}

//Original version of merge sort. This does not incorporate the concept of sentinel card.
import java.util.*;
public class cforcesq1
{
    int arr[];
    public cforcesq1(int n)
    {
        arr = new int[n];
    }
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        cforcesq1 obj = new cforcesq1(n);
        int x = sc.nextInt();
        for(int i=0;i<n;i++)
        {
            obj.arr[i] = sc.nextInt();
        }
        obj.merge(obj.arr,0,n-1);
        obj.find_mex(x);
    }
    void find_mex(int m)
    {
        if(arr[0]==m)
        {
            System.out.println(m+1);
        }
        else if(arr[0]>m)
        {
            System.out.println(m);
        }
        else
        {
            for(int i=0;i<arr.length;i++)
            {
                if(arr[i]>m)
                {
                    System.out.println(m-i);
                    break;
                }
                else if(arr[i]==m)
                {
                    System.out.println(i+1);
                    break;
                }
            }
        }
    }
    void merge(int[] a, int p, int r)
    {
        if(p<r)
        {
            int q=(p+r)/2;
            merge(a, p, q);
            merge(a, q+1, r);
            m(a, p, q, r);
        }
    }
    void m(int[] a, int j, int k, int l)
    {
        if(a[k]>a[k+1]){
        int x[]=new int[k-j+2];
        int y[]=new int[l-k+1];
        for(int i=j; i<=l; i++)
        {
            if(i<=k)
                x[i-j]=a[i];
            else
                y[i-k-1]=a[i];
            }
        x[k-j+1]=10000;
        y[l-k]=10000;
        int m=0,n=0;
        for(int i=j; i<=l; i++)
        {
            if(x[m]<y[n])
            {
                a[i]=x[m];
                m++;
            }
            else
            {
                a[i]=y[n];
                n++;
            }
        }
    }
    }
}

import java.util.*;
public class Oheduniya {

    public static void main(String[] args) {
        Set<Integer> st;
        st = new HashSet<>();
        int n, m;
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        m = in.nextInt();
        int ara[] = new int[n];
        for(int i = 0; i<n; i++)
        {
            ara[i] = in.nextInt();
            st.add(ara[i]);
        }
        int cnt = 0;
        for(int i = 0; i<m; i++)
        {
            if(st.contains(i)==false) cnt++;
        }
        if(cnt==0 && st.contains(m)==true) cnt++;
        System.out.println(cnt);
    }

}

import java.util.Scanner;

public class cf {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int min = 101;
        for (int i = 0; i < n; i++) {
            int tmp = sc.nextInt();
            if(tmp<min) min = tmp;
        }
        System.out.println(x <= min ? x : x-min-1);
    }
}

// 20.09.2017
//

/*
������������ ����� �� ����� 4, 2, 7, 12
*/

import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class Sample03_01
{
    public static final int K = 126;
    public static long Pow2 (int b, int k)   // b^k
    {
        long res = b;
        for ( int i=1; i < k; i++ )
            res *= b;
        return res;
    }
    public static void Sorting (int f [], int n)
    {
        for ( int i=0; i < n; i++ )
            for ( int j=0; j < n-1-i; j++ )
                if ( f [j] > f [j+1] )
                {
                    int x = f [j]; f [j] = f [j+1]; f [j+1] = x;
                }
    }
    long gcd (long a, long b)
    {
        long r;
        while ( b != 0 )
        {
            r = a % b;
            a = b;
            b = r;
        }
        return a;
    }
    public static void main (String [] param)
    {
        boolean oj = System.getProperty ("ONLINE_JUDGE") != null;
        Scanner in = new Scanner (System.in);
        PrintWriter out = new PrintWriter (System.out);
        FileReader reader;
        Writer writer;

        if ( ! oj )
        {
            try
            {
                reader = new FileReader ("C:\\TRR\\2017\\Task\\07 Codeforces\\026\\A.TXT");
                in = new Scanner (reader);
            }
            catch (IOException ex)
            {
                System.out.println (ex.getMessage());
            }

            try
            {
                writer = new FileWriter ("C:\\TRR\\2017\\Task\\07 Codeforces\\026\\A.OUT", false);
                out = new PrintWriter (writer);
            }
            catch (IOException ex)
            {
                System.out.println (ex.getMessage());
            }
        }

        int n = in.nextInt ();
        int x = in.nextInt ();
        int [] a = new int [n];
        int [] mask = new int [K];
        for ( int i=0; i < K; i++ )
            mask [i] = 0;
        for ( int i=0; i < n; i++ )
        {
            a [i] = in.nextInt ();
            mask [a [i]] = 1;
        }

        if ( ! oj )
        {
            out.println ("n = " + n + " x = " + x);
            for ( int i=0; i < n; i++ )
                out.print (a [i] + " ");
            out.println ();
        }
/*
        Sorting (a, n);
        int mex = n, nmex = n;
        for ( int i=0; i < n; i++ )
            if ( a [i] != i )
            {
                mex = i;
                nmex = i;
                break;
            }

        if ( ! oj )
        {
            out.println ("mex = " + mex + " nmex = " + nmex);
        }

        int k = 0;
        if ( a [0] == 0 && x == 0 )
            k = 1;
        else if ( mex == x )
        {
            k = 0;
            if ( nmex >= n )
                k++;
        }
        else if ( mex < x )
        {
            int kol = 0;
            for ( int l=mex; l < n; l++ )
                if ( a [l] < x )
                    kol++;
            k = x - mex - kol;
        }
        else
        {
            k = mex - x;
            if ( nmex >= n )
                k++;
        }
*/
        int k = 0;
        for ( int i=0; i <= x; i++ )
            if ( i == x )
            {
                if ( k > 0 )
                    break;
                if ( mask [i] == 0 )
                    k = 0;
                else
                    k = 1;
                break;
            }
            else if ( mask [i] == 0 )
                k++;

        out.println (k);

        out.flush();
    }
}

import java.math.*;
import java.io.*;
import java.util.*;

	public class CODE1
	{
		private InputStream is;
		private PrintWriter w;
		int time = 0, DP[], start[], end[], dist[], black[], MOD = (int) (1e9 + 7),
				arr[], weight[][], x[], y[], parent[];
		int MAX = 1000000, N, K;
		long red[];
		ArrayList<Integer>[] amp;
		ArrayList<Pair>[][] pmp;
		static ArrayList<Integer> adj[];
		boolean b[], boo[][];
		Pair prr[];
		HashMap<Pair, Integer> hm = new HashMap();
		long Dp[][][][] = new long[110][110][12][12];

		void soln()
		{
			is = System.in;
			w = new PrintWriter(System.out);
			long s = System.currentTimeMillis();
			solve();
			// out.close();
			w.flush();
			// tr(System.currentTimeMillis() - s + "ms");
		}

		public static void main(String[] args) throws Exception
		{
			new Thread(null, new Runnable()
			{
				public void run()
				{
					try
					{
						// new CODEFORCES().soln();
					} catch (Exception e)
					{
						System.out.println(e);
					}
				}
			}, "1", 1 << 26).start();
			new CODE1().soln();
		}

		int ans = 0, cost = 0, D[][];
		char ch[], ch1[];
		int hash = 29;
		TreeSet<Cell> ts;
		int prime[] = new int[100000];

		/*author:Mihir Gajera-DAIICT*/

		void solve()
		{
			int n=ni();
			int x=ni();
			int a[]=new int[n];
			for(int i=0;i<n;i++)
				a[i]=ni();
			Arrays.sort(a);
			int min=0;
			int op=0;

			if(n==1)
			{
				if(a[0]==x)
				{
					w.println(x+1);
					return;
				}
				else
				{
					if(a[0]<x)
					{
						w.println(x);
					}
					else
					{
						w.println(x-1);
					}
					return;
				}
			}
			for(int i=0;i<n-1;i++)
			{
			//System.out.println(i);
				if(x<a[i])
				{
					op=op+a[i]-x-1;
					break;
				}
				else if(x>a[i] && x<a[i+1])
				{
					op+=x-a[i]-1;
					break;
				}
				else
				{
					if(x==a[i])
					{		op++;
					break;}
					else
					{
						if(i==0)
							op+=a[0];
						op+=a[i+1]-a[i]-1;
					}
				}

			}
			w.println(op);
		}

		boolean isCons(char ch){
			if(ch!='a' && ch!='e' && ch!='i' && ch!='o' && ch!='u' && ch!=' ') return true;
			return false;
		}
		int dp[][] = new int[1000][1000];

		void seive(int x){
			b = new boolean[x+1];
			for(int i = 2;i*i<=x;i++){
				if(!b[i]){
					for(int j = 2*i;j<=x;j+=i) b[j] = true;
				}
			}
		}
		long[][] matMul(long a[][] , long b[][], int n)
		{
			long res[][] = new long[n][n];
			for(int i = 0;i<n;i++){
				for(int j = 0;j<n;j++){
					long sum = 0;
					for(int k = 0;k<n;k++){
						sum += (a[i][k]*1l*b[k][j]);
						sum %= MOD;
					}
					res[i][j] = sum;
				}
			}
			return res;
		}
		int min(int a, int b)
		{
			return (a<b)?a:b;
		}
		private class Cell implements Comparable<Cell>
		{
			int u, v, s;
			public Cell(int u, int v, int s)
			{
				this.u = u;
				this.v = v;
				this.s = s;
			}
			public int hashCode()
			{
				return Objects.hash();
			}
			public int compareTo(Cell other)
			{
				return (Long.compare(s, other.s) != 0 ? (Long.compare(s, other.s)):(Long.compare(v, other.v)!=0?Long.compare(v, other.v):Long.compare(u, other.u)))
						&((Long.compare(s, other.s) != 0 ? (Long.compare(s, other.s)):(Long.compare(u, other.v)!=0?Long.compare(u, other.v):Long.compare(v, other.u))));
			}
			public String toString()
			{
				return this.u + " " + this.v;
			}
		}

		class Pair implements Comparable<Pair>
		{
			int u, v, i;

			Pair(int u, int v)
			{
				this.u = u;
				this.v = v;
			}

			Pair()
			{

			}

			Pair(int u, int v, int i)
			{
				this.u = u;
				this.v = v;
				this.i = i;
			}

			public int hashCode()
			{
				return Objects.hash();
			}

			public boolean equals(Object o)
			{
				Pair other = (Pair) o;
				return ((u == other.u && v == other.v) | ((u == other.v && v == other.u)));
			}

			public int compareTo(Pair other)
			{
				// return Integer.compare(val, other.val);
				return Long.compare(u, other.u) != 0 ? (Long.compare(u, other.u)): (Long.compare(v, other.v));
						//&(Long.compare(u, other.v) != 0 ? (Long.compare(u, other.v)): (Long.compare(v, other.u))));
			}

			public String toString()
			{
				return this.u + " " + this.v;
			}
		}

		int max(int a, int b)
		{
			if (a > b)
				return a;
			return b;
		}

		public static class FenwickTree
		{

			int[] array; // 1-indexed array, In this array We save cumulative
							// information to perform efficient range queries and
							// updates

			public FenwickTree(int size)
			{
				array = new int[size + 1];
			}

			public int rsq(int ind)
			{
				assert ind > 0;
				int sum = 0;
				while (ind > 0)
				{
					sum += array[ind];
					// Extracting the portion up to the first significant one of the
					// binary representation of 'ind' and decrementing ind by that
					// number
					ind -= ind & (-ind);
				}
				return sum;
			}

			public int rsq(int a, int b)
			{
				assert b >= a && a > 0 && b > 0;
				return rsq(b) - rsq(a - 1);
			}

			public void update(int ind, int value)
			{
				assert ind > 0;
				while (ind < array.length)
				{
					array[ind] += value;
					// Extracting the portion up to the first significant one of the
					// binary representation of 'ind' and incrementing ind by that
					// number
					ind += ind & (-ind);
				}
			}

			public int size()
			{
				return array.length - 1;
			}
		}

		void buildGraph(int n)
		{
			for (int i = 0; i < n; i++)
			{
				int x1 = ni() - 1, y1 = ni() - 1, z = ni();
				ts.add(new Cell(x1,y1,z));
				hm.put(new Pair(x1,y1), z);
				ans += z;
			}
		}

		long modInverse(long a, long mOD2)
		{
			return power(a, mOD2 - 2, mOD2);
		}

		long power(long x, long y, long m)
		{
			if (y == 0)
				return 1;
			long p = power(x, y / 2, m) % m;
			p = (p * p) % m;

			return (y % 2 == 0) ? p : (x * p) % m;
		}

		public long gcd(long a, long b)
		{
			if (b == 0)
				return a;
			return gcd(b, a % b);
		}

		static class ST1
		{
			int arr[], st[], size;

			ST1(int a[])
			{
				arr = a.clone();
				size = 10 * arr.length;
				st = new int[size];
				build(0, arr.length - 1, 1);
			}

			void build(int ss, int se, int si)
			{
				if (ss == se)
				{
					st[si] = arr[ss];
					return;
				}
				int mid = (ss + se) / 2;
				int val = 2 * si;
				build(ss, mid, val);
				build(mid + 1, se, val + 1);
				st[si] = Math.min(st[val], st[val + 1]);
			}

			int get(int ss, int se, int l, int r, int si)
			{
				if (l > se || r < ss || l > r)
					return Integer.MAX_VALUE;
				if (l <= ss && r >= se)
					return st[si];
				int mid = (ss + se) / 2;
				int val = 2 * si;
				return Math.min(get(ss, mid, l, r, val),
						get(mid + 1, se, l, r, val + 1));
			}
		}

		static class ST
		{
			int arr[], lazy[], n;

			ST(int a)
			{
				n = a;
				arr = new int[10 * n];
				lazy = new int[10 * n];
			}

			void up(int l, int r, int val)
			{
				update(0, n - 1, 0, l, r, val);
			}

			void update(int l, int r, int c, int x, int y, int val)
			{
				if (lazy[c] != 0) {
					lazy[2 * c + 1] += lazy[c];
					lazy[2 * c + 2] += lazy[c];
					if (l == r)
						arr[c] += lazy[c];
					lazy[c] = 0;
				}
				if (l > r || x > y || l > y || x > r)
					return;
				if (x <= l && y >= r)

				{
					lazy[c] += val;
					return;
				}
				int mid = l + r >> 1;
				update(l, mid, 2 * c + 1, x, y, val);
				update(mid + 1, r, 2 * c + 2, x, y, val);
				arr[c] = Math.max(arr[2 * c + 1], arr[2 * c + 2]);
			}

			int an(int ind)
			{
				return ans(0, n - 1, 0, ind);
			}

			int ans(int l, int r, int c, int ind)
			{
				if (lazy[c] != 0)
				{
					lazy[2 * c + 1] += lazy[c];
					lazy[2 * c + 2] += lazy[c];
					if (l == r)
						arr[c] += lazy[c];
					lazy[c] = 0;
				}
				if (l == r)
					return arr[c];
				int mid = l + r >> 1;
				if (mid >= ind)
					return ans(l, mid, 2 * c + 1, ind);
				return ans(mid + 1, r, 2 * c + 2, ind);
			}
		}

		public static int[] shuffle(int[] a, Random gen)
		{
			for (int i = 0, n = a.length; i < n; i++)
			{
				int ind = gen.nextInt(n - i) + i;
				int d = a[i];
				a[i] = a[ind];
				a[ind] = d;
			}
			return a;
		}

		long power(long x, long y, int mod)
		{
			long ans = 1;
			while (y > 0)
			{
				if (y % 2 == 0)
				{
					x = (x * x) % mod;
					y /= 2;
				} else
				{
					ans = (x * ans) % mod;
					y--;
				}
			}
			return ans;
		}

		// To Get Input
		// Some Buffer Methods
		private byte[] inbuf = new byte[1024];
		public int lenbuf = 0, ptrbuf = 0;

		private int readByte()
		{
			if (lenbuf == -1)
				throw new InputMismatchException();
			if (ptrbuf >= lenbuf)
			{
				ptrbuf = 0;
				try
				{
					lenbuf = is.read(inbuf);
				} catch (IOException e)
				{
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return -1;
			}
			return inbuf[ptrbuf++];
		}

		private boolean isSpaceChar(int c)
		{
			return !(c >= 33 && c <= 126);
		}

		private int skip()
		{
			int b;
			while ((b = readByte()) != -1 && isSpaceChar(b))
				;
			return b;
		}

		private double nd()
		{
			return Double.parseDouble(ns());
		}

		private char nc()
		{
			return (char) skip();
		}

		private String ns()
		{
			int b = skip();
			StringBuilder sb = new StringBuilder();
			while (!(isSpaceChar(b)))
			{ // when nextLine, (isSpaceChar(b) && b != '
										// ')
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		private char[] ns(int n)
		{
			char[] buf = new char[n];
			int b = skip(), p = 0;
			while (p < n && !(isSpaceChar(b)))
			{
				buf[p++] = (char) b;
				b = readByte();
			}
			return n == p ? buf : Arrays.copyOf(buf, p);
		}

		private char[][] nm(int n, int m)
		{
			char[][] map = new char[n][];
			for (int i = 0; i < n; i++)
				map[i] = ns(m);
			return map;
		}

		private int[] na(int n)
		{
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = ni();
			return a;
		}

		private int ni()
		{
			int num = 0, b;
			boolean minus = false;
			while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
				;
			if (b == '-')
			{
				minus = true;
				b = readByte();
			}

			while (true)
			{
				if (b >= '0' && b <= '9')
				{
					num = num * 10 + (b - '0');
				} else
				{
					return minus ? -num : num;
				}
				b = readByte();
			}
		}

		private long nl()
		{
			long num = 0;
			int b;
			boolean minus = false;
			while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
				;
			if (b == '-')
			{
				minus = true;
				b = readByte();
			}

			while (true)
			{
				if (b >= '0' && b <= '9')
				{
					num = num * 10 + (b - '0');
				} else
				{
					return minus ? -num : num;
				}
				b = readByte();
			}
		}

		private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

		private void tr(Object... o)
		{
			if (!oj)
				System.out.println(Arrays.deepToString(o));
		}
	}

import java.io.*;
import java.util.*;

public class JavaPuzzler {

    //Scanner sc;
    private FastScanner sc;
    private PrintWriter out;

    int[] nums;

    public void solve() {
        int n = sc.nextInt();
        int x = sc.nextInt();
        nums = new int[101];
        for (int i = 0; i < n; ++i) {
            ++nums[sc.nextInt()];
        }
        int cnt = 0;
        for (int i = 0; i < x; ++i) {
            if (nums[i] > 0) ++cnt;
        }
        if (nums[x] > 0) ++cnt;
        out.println(cnt);
    }

    private void run() {
//        try {
//            sc = new FastScanner(new File("input.txt"));
////            out = new PrintWriter(new File("output.txt"));
//        out = new PrintWriter(System.out);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }

        sc = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();

        out.close();

    }

    public static void main(String[] args) {
        new JavaPuzzler().run();
    }

    private class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null) {
                    return null;
                }
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null) {
                    return false;
                }
                st = new StringTokenizer(s);
            }
            return true;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

import java.util.Scanner;

public class Codeforces862A {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int x = scan.nextInt();
		int count = 0;
		scan.nextLine();
		int s = scan.nextInt();

		for (int i = 0; i < x-1; i++) {
		count++;
        }
		System.out.println(count);

	}

}

import java.util.*;

public class A{
		static int MaxN=(int)1e6;
static Scanner scan=new Scanner(System.in);
static int [] reverse(int a[], int n)
    {
        int[] b = new int[n];
        int j = n;
        for (int i = 0; i < n; i++) {
            b[j - 1] = a[i];
            j = j - 1;
        }
return b;
         }
static int []ret(int ar[]){

int bol[]=new int[MaxN];
Arrays.fill(bol,-1);
  for (int i : ar) {
      bol[i] = 1;
    }
return bol;
}
public static void main(String[] args)
{

	int bol[]=new int[105];
int n=scan.nextInt();
int mex=scan.nextInt();
for(int i=0;i<n;i++){
	int a=scan.nextInt();
	bol[a]=1;
}
bol[mex]=1;
int ans=0;
for(int i=0;i<mex;i++){
if(bol[i]==0)
	ans++;

}
System.out.println(ans);
}
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class A435 {

  public void solve() throws IOException {
    int n = ni();
    int x = ni();
    TreeSet<Integer> vals = new TreeSet();
    for (int i = 0; i < n; i++)
      vals.add(ni());
    if (x == 0) {
       if (vals.contains(x))
         System.out.println(1);
       else
         System.out.println(0);
       return;
    }
    int numops = 0;
    for (int i = 0; i < x; i++) {
      if (vals.contains(i)) {
        vals.remove(i);
        numops++;
      }
    }
    if (!vals.contains(x)) {
      vals.add(x);
      numops++;
    }
    System.out.println(numops);
  }

  public int mex(TreeSet<Integer> vals) {
    int n = vals.size();
    int mex = 0;
    for (int i = 0; i < n; i++) {
      if (!vals.contains(i)) {
        mex = i;
        break;
      }
    }
    return mex;
  }

  public BufferedReader br;
  public StringTokenizer st;
  public PrintWriter out;

  public String nextToken() throws IOException {
    while(st == null || !st.hasMoreTokens())
      st = new StringTokenizer(br.readLine());
    return st.nextToken();
  }

  public String nextLine() throws IOException {
    return br.readLine();
  }

  public int ni() throws IOException {
    return Integer.parseInt(nextToken());
  }

  public long nl() throws IOException {
    return Long.parseLong(nextToken());
  }

  public double nd() throws IOException {
    return Double.parseDouble(nextToken());
  }

  public void run() throws IOException {
    br = new BufferedReader(new InputStreamReader(System.in));
    out = new PrintWriter(new OutputStreamWriter(System.out));
    solve();
  }

  public static void main(String args[]) throws IOException {
    new A435().run();
  }
}

import java.util.*;
public class Mex {
    public static void main(String args[]){
        Scanner sc= new Scanner(System.in);
        int n= sc.nextInt();
        int num=sc.nextInt();
        HashSet<Integer> hs= new HashSet<Integer>();
        int arr[]= new int[n];
        for(int i=0;i<n;i++){
            arr[i]=sc.nextInt();
            hs.add(arr[i]);
        }
        int i=0;
        for(i=0;i<n;i++)
            if(!hs.contains(i))
                break;
        int mex=i;
        int count=0;
        if(mex<num){
            for(i=mex;i<num;i++)
                if(!hs.contains(i))
                    count++;
        }
        if(mex>num){
            count=1;

        }
        System.out.println(count);
    }
}

import java.util.*;
public class A862
{
    public static void main(String...arg)
    {
        int x,n,c=0,c1=0,c2=0,i,j,k;
        Scanner sc=new Scanner(System.in);
        n=sc.nextInt();
        x=sc.nextInt();
        int a[]=new int[n];
        for(i=0;i<n;i++)
        {
            a[i]=sc.nextInt();
        }
        for(i=0;i<x;i++)
        {
            c1=0;
            for(j=0;j<n;j++)
            {
                if(i==a[i])
                {
                    c1=1;
                    break;
                }
                //if(i==x&&a[i]==i)
                //c1=0;
            }
            if(c1==0)
            c++;
        }
        for(j=0;j<n;j++)
        {
            if(a[j]==x)
            {
                c++;
            }
        }
        System.out.println(c);
    }
}

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Paras
 */
public class codechef3 {

    public static void main(String args[]){

        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int x=in.nextInt();
        int a[]=new int[n];
        int c=0;
        int ans=0;
        int b=0;

        for(int i=0;i<n;i++){

            a[i]=in.nextInt();

        }
        int j=0;
        for(int i=0;i<=x;i++){

            if(a[j]!=x && i==x)
                j++;
            else
            if(a[j]!=i || a[j]==x)
                ans++;
            else
                j++;

        }
        System.out.println(ans);

    }
}

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class bbg
{
	public static int result;

public static ArrayList<Integer> [] graph;

public static int[]cats;

public static int vizitat[];
public static int x;

	public static void main (String[] args) throws java.lang.Exception
{

Scanner input=new Scanner(System.in);

HashMap<String, Integer> map1= new HashMap<String, Integer>();
HashMap<String, Integer> map2= new HashMap<String, Integer>();

		int n=input.nextInt();

		int x=input.nextInt();

		int v[]=new int[101];

		for(int i=0;i<n;i++) {

			int a=input.nextInt();

			v[a]++;

			}

			int contor=0;

			for(int i=0;i<x;i++)

				if(v[i]==0) contor++;

				System.out.println(contor);

}

}

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Paras
 */
public class codechef3 {

    public static void main(String args[]){

        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int x=in.nextInt();
        int a[]=new int[n];
        int c=0;
        int ans=0;
        int b=0;

        for(int i=0;i<n;i++){

            a[i]=in.nextInt();

            b++;

            if(a[i]>=x && c==0){

                b=b-1;

                ans=x-b;
                if(a[i]==x)
                    ans+=1;
                c++;
            }

        }
        System.out.println(ans);

    }
}

import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class R435A {

    FastScanner sc;
    PrintWriter out;

    int n;
    int X;
    int[] arr;

    static int mex(int x, int[] arr) {
        int res = 0;
        Arrays.sort(arr);

        int maxx = arr[arr.length-1];
        int minn = arr[0];

        // left
        if (x > maxx)  {
            res = maxx+1;
            return res;
        }
        // right
        if (x < minn)  {
            res = minn-1;
            return res;
        }
        // inside
        res = (x - arr[0])-1;

        /*for (int i=1; i<arr.length; i++) {
            int diff = arr[i] - arr[i-1];
            if (diff > 1) {
                res = arr[i-1]+1;
                break;
            }
        }*/

        return res;
    }

    public void solve()  {
        n = sc.nextInt();
        X = sc.nextInt();
        arr = new int[n];
        for (int i=0; i<n; i++) {
            arr[i] = sc.nextInt();
        }

        if (mex(X, arr) == X) {
            out.println(0);
            return;
        }

        if (X == 0) {
            System.out.println(1);
            return;
        }

        if (n == 1) {
            out.println(1);
            return;
        }

        out.println(mex(X, arr));

        //Arrays.sort(arr);

    }

    private void run() {
       //sc = new FastScanner(new File("input.txt"));
        sc = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();
        out.close();
    }

    public static void main(String[] args) {
        new R435A().run();
    }

    private class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

import java.util.Scanner;

public class A {
public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int n = scan.nextInt();
	int req = scan.nextInt();
	int[] arr = new int[n];
	int MEX = -1;
	for(int i= 0 ;i<arr.length;i++)
	{
		arr[i] = scan.nextInt();
	}
	boolean[] flags = new boolean[arr[n-1]+1];
	for(int i = 0 ;i<flags.length;i++)
	{
		for(int k = 0;k<arr.length;k++)
		{
			if(i==arr[k]){
				flags[i] = true;
				break;
			}
		}
	}

	for(int i = 0 ; i < flags.length ; ++i)
	{
		if(!flags[i]){
			MEX = i;
			break;
		}
	}

	if(MEX==-1)
	{
//		System.out.println(MEX);
		System.out.println(req<flags.length?"1":req-(arr[n-1]+1));
	}
	else{
	int count = 0 ;
	if(req<=arr[n-1]){
	if(flags[req])
		count =1;
	for(int i = MEX;i<req;i++)
	{
		if(!flags[i])
			count++;
		}

	}else{
		for(int i = MEX;i<flags.length;i++)
		{
			if(!flags[i])
				count++;
		}
		count+=(req-arr[n-1]);
	}
//	System.out.println(MEX);
	System.out.println(count);

}
}
}

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Paras
 */
public class codechef3 {

    public static void main(String args[]){

        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int x=in.nextInt();
        int a[]=new int[n];
        int c=0;
        int ans=0;
        int b=0;
        HashSet<Integer> h=new HashSet();
        for(int i=0;i<n;i++){

            a[i]=in.nextInt();
            if(a[i]>=x && c==0){

                if(a[i]==x)
                    ans=x-b+1;
                else
                    ans=x-b;
                c++;
            }
            h.add(a[i]);
            b++;

        }
        System.out.println(ans);

    }
}

/*
 * Author Ayub Subhaniya
 * Institute DA-IICT
 */

import java.io.*;
import java.util.*;

public class Codeforces429A
{

	InputStream in;
	PrintWriter out;

	void solve()
	{
		int n=ni();
		int x=ni();
		boolean present[]=new boolean[102];
		for (int i=0;i<n;i++)
			present[ni()]=true;
		int mex=0;
		while (present[mex])
			mex++;
		if (mex==x)
		{
			out.println(0);
		}
		else if (mex>x)
		{
			out.println(mex-x+1);
		}
		else
		{
			int cnt=0;
			for (int i=mex;i<x;i++)
				if (!present[i])
					cnt++;
			out.println(cnt);
		}
	}

	void run() throws Exception
	{
		String INPUT = "C:/Users/ayubs/Desktop/input.txt";
		in = oj ? System.in : new FileInputStream(INPUT);
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis() - s + "ms");

	}
	public static void main(String[] args) throws Exception
	{
		new Codeforces429A().run();
	}

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf)
		{
			ptrbuf = 0;
			try
			{
				lenbuf = in.read(inbuf);
			}
			catch (IOException e)
			{
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean inSpaceChar(int c)
	{
		return !(c >= 33 && c <= 126);
	}

	private int skip()
	{
		int b;
		while ((b = readByte()) != -1 && inSpaceChar(b))
			;
		return b;
	}

	private double nd()
	{
		return Double.parseDouble(ns());
	}

	private char nc()
	{
		return (char) skip();
	}

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(inSpaceChar(b)))
		{ // when nextLine, (inSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(inSpaceChar(b)))
		{
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-')
		{
			minus = true;
			b = readByte();
		}

		while (true)
		{
			if (b >= '0' && b <= '9')
			{
				num = num * 10 + (b - '0');
			}
			else
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-')
		{
			minus = true;
			b = readByte();
		}

		while (true)
		{
			if (b >= '0' && b <= '9')
			{
				num = num * 10 + (b - '0');
			}
			else
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

	private void tr(Object... o)
	{
		if (!oj)
			System.out.println(Arrays.deepToString(o));
	}

}

import java.io.*;
import java.util.*;

public class X {

	public static void main(String[] args) {
		FastScanner in=new FastScanner();
		PrintWriter out=new PrintWriter(System.out);
	//	int t=in.nextInt();
	//	while(t-->0)
		solve(in,out);
		out.close();
	}

    static void solve(FastScanner in,PrintWriter out){
      int n=in.nextInt();
      int x=in.nextInt();
      int a[]=new int[n]; a=in.readArray(n);
      sort(a);
      int count=0;
      HashSet<Integer> h=new HashSet<>();
      int f=0;
      for(int i=0;i<n;i++){ if(a[i]==x) count++; h.add(a[i]); }
      for(int i=0;i<x;i++) if(!h.contains(i)) f++;
      out.println((f*2)+Math.max(0,count-x));
    }

	static void sort(int[] a) {
		ArrayList<Integer> l=new ArrayList<>();
		for (int i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}

	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}

}

import java.util.Scanner;

public class Driver {

	public static Scanner scanner;
	public static void main(String[] args) {
		scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		int x = scanner.nextInt();
		int[] evil = new int[n];
		int count = 0;
		boolean isPresent = false;
		int min = Integer.MIN_VALUE;
		for(int i=0; i<n; i++) {
			evil[i] = scanner.nextInt();
			if(evil[i] == x) isPresent = true;
			if(evil[i] < x) count++;
			min = Math.min(min, evil[i]);
		}

		int res = 0;
		for(int i=0; i<x; i++) {
			res++;
		}

		int result = 0;
		if(isPresent) {

		}else {
			result = res-count;
		}

		if(isPresent) result++;

		System.out.println(result);

	}
}

//package a.codeforces.rating;

import java.util.*;
import java.io.*;
import static java.lang.Math.*;
import java.math.BigInteger;
public class Main {

   //static ArrayList<Integer> a = new ArrayList();
    public static void main(String[] args) {

        FastReader in = new FastReader();
        StringBuilder out =new StringBuilder();
         int n = in.nextInt();
         int x = in.nextInt();

         boolean [] b = new boolean[x+1];
         for (int i = 0; i <n; i++) {

            if(in.nextInt()<x){
                b[i]=true;
            }
        }
         int c =0;
         for(int i=x; i>=0;i--){
             if(i==x&&b[i]){
                c++;
             }else if(i!=x&&!b[i]){
                c++;
             }
         }
         System.out.println(c);

    }
}

class FastReader {

    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }
}

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Paras
 */
public class codechef3 {

    public static void main(String args[]){

        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int x=in.nextInt();
        int a[]=new int[n];
        int c=0;
        int ans=0;
        int b=0;

        for(int i=0;i<n;i++){

            a[i]=in.nextInt();

        }
        Arrays.sort(a);
        for(int i=0;i<n;i++){

            if(a[i]>=x && c==0){

                if(a[i]==x)
                    ans=x-b+1;
                else
                    ans=x-b;
                c++;
            }

            b++;
        }
        System.out.println(ans);

    }
}

// 20.09.2017
//

/*
������������ ����� �� ����� 4
*/

import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class Sample03_01
{
    public static final int K = 26;
    public static long Pow2 (int b, int k)   // b^k
    {
        long res = b;
        for ( int i=1; i < k; i++ )
            res *= b;
        return res;
    }
    public static void Sorting (int f [], int n)
    {
        for ( int i=0; i < n; i++ )
            for ( int j=0; j < n-1-i; j++ )
                if ( f [j] > f [j+1] )
                {
                    int x = f [j]; f [j] = f [j+1]; f [j+1] = x;
                }
    }
    long gcd (long a, long b)
    {
        long r;
        while ( b != 0 )
        {
            r = a % b;
            a = b;
            b = r;
        }
        return a;
    }
    public static void main (String [] param)
    {
        boolean oj = System.getProperty ("ONLINE_JUDGE") != null;
        Scanner in = new Scanner (System.in);
        PrintWriter out = new PrintWriter (System.out);
        FileReader reader;
        Writer writer;

        if ( ! oj )
        {
            try
            {
                reader = new FileReader ("C:\\TRR\\2017\\Task\\07 Codeforces\\026\\A.TXT");
                in = new Scanner (reader);
            }
            catch (IOException ex)
            {
                System.out.println (ex.getMessage());
            }

            try
            {
                writer = new FileWriter ("C:\\TRR\\2017\\Task\\07 Codeforces\\026\\A.OUT", false);
                out = new PrintWriter (writer);
            }
            catch (IOException ex)
            {
                System.out.println (ex.getMessage());
            }
        }

        int n = in.nextInt ();
        int x = in.nextInt ();
        int [] a = new int [n];
        for ( int i=0; i < n; i++ )
            a [i] = in.nextInt ();

        if ( ! oj )
        {
            out.println ("n = " + n + " x = " + x);
            for ( int i=0; i < n; i++ )
                out.print (a [i] + " ");
            out.println ();
        }

        Sorting (a, n);
        int mex = n, nmex = n;
        for ( int i=0; i < n; i++ )
            if ( a [i] != i )
            {
                mex = i;
                nmex = i;
                break;
            }

        if ( ! oj )
        {
            out.println ("mex = " + mex + " nmex = " + nmex);
        }

        int k = 0;
        if ( a [0] == 0 && x == 0 )
            k = 1;
        else if ( mex == x )
        {
            k = 0;
            if ( nmex >= n )
                k++;
        }
        else if ( mex < x )
        {
            int kol = 0;
            for ( int l=mex; l < n; l++ )
                if ( a [l] < x )
                    kol++;
            k = x - mex - kol;
        }
        else
        {
            k = mex - x;
            if ( nmex >= n )
                k++;
        }

        out.println (k);

        out.flush();
    }
}

import java.io.*;
import java.util.*;

public class X {

	public static void main(String[] args) {
		FastScanner in=new FastScanner();
		PrintWriter out=new PrintWriter(System.out);
	//	int t=in.nextInt();
	//	while(t-->0)
		solve(in,out);
		out.close();
	}

    static void solve(FastScanner in,PrintWriter out){
      int n=in.nextInt();
      int x=in.nextInt();
      int a[]=new int[n]; a=in.readArray(n);
      sort(a);
      int count=0;
      HashSet<Integer> h=new HashSet<>();
      int f=0;
      for(int i=0;i<n;i++){ if(a[i]==x) count++; h.add(a[i]); }
      for(int i=0;i<x;i++) if(!h.contains(i)) f++;
      out.println(Math.max(f,count));
    }

	static void sort(int[] a) {
		ArrayList<Integer> l=new ArrayList<>();
		for (int i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}

	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}

}

import java.util.Arrays;
import java.util.Scanner;

public class Mex {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int x = scanner.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextInt();
        }
        Arrays.sort(a);
        if (x < a[0]) {
            System.out.println("0");
            return;
        }
        int i = 0;
        while (a[i] < x){
            i++;
        }
        if(a[i] - x == 1){
            System.out.println("2");
            return;
        }
        int res = a[i] - x  - i + 1;
        System.out.println(res);
    }
}

import java.util.*;
import java.util.Map.Entry;
import java.util.regex.Pattern;
import java.io.*;
import java.math.BigInteger;

public class MainClass {

	 public static void main(String[] args) {
		 FastReader in = new FastReader();

		 int n = in.nextInt();
		 int x = in.nextInt();

		 int arr[] = new int[n];

		 for (int i=0; i<n; i++){
			 arr[i] = in.nextInt();
		 }

		 Arrays.sort(arr);

		 int f;
		 if(arr[0]-x<0)
			 f=x-arr[0];
		 else
			 f=arr[0]-x;

		 if(f-1<0)
			 f=1-f;
		 else
			 f=f-1;

		 System.out.println(f);

	 }

}

class FastReader
{
    BufferedReader br;
    StringTokenizer st;

    public FastReader()
    {
        br = new BufferedReader(new
                 InputStreamReader(System.in));
    }

    String next()
    {
        while (st == null || !st.hasMoreElements())
        {
            try
            {
                st = new StringTokenizer(br.readLine());
            }
            catch (IOException  e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt()
    {
        return Integer.parseInt(next());
    }

    long nextLong()
    {
        return Long.parseLong(next());
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String nextLine()
    {
        String str = "";
        try
        {
            str = br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}

import java.util.*;
import java.io.*;
public class a {
	public static void main(String[] arg) {
		new a();
	}
	public a() {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int x = in.nextInt();
		int ret = 0;
		HashSet<Integer> hs = new HashSet<Integer>();
		for(int i = 0; i < n; i++) {
			int v = in.nextInt();
			if(v == x) ret++;
			if(v < x) hs.add(v);
		}
		System.out.println(ret+((x+1)-hs.size()));
	}
}

import java.util.*;
public class One {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int ar[] = new int[n];
        for (int i = 0; i < n; i++){
            ar[i] = sc.nextInt();
        }
        System.out.println(F(ar,n,x));
    }
    public static int F(int ar[], int n, int x) {
        int count = 0;
        if (ar[0] == x) count += x+1;
        else {
            if (ar[0] < x) count += ar[0];
            else {
                for (int i = 1; i < n; i++) {
                    if (ar[i] < x) {
                        count += ar[i] - ar[i - 1] - 1;
                    } else if (ar[i] == x) {
                        count++;
                        break;
                    } else {
                        count += x - ar[i - 1] - 1;
                        break;
                    }
                }
            }
        }
        return count;
    }

}

import java.util.*;
import java.io.*;

public class MEX
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
			int N = sc.nextInt();
			int X = sc.nextInt();
			Set<Integer> set = new HashSet<Integer>();
			for(int i=0; i<N; i++)
			{
				int value = sc.nextInt();
				set.add(value);
			}
			int SmallestvalueToSearch = 0;
			int steps = 0;
			while(true)
			{
				if(set.contains(SmallestvalueToSearch) && SmallestvalueToSearch!=X)
				{
					SmallestvalueToSearch++;
				}
				else if(!set.contains(SmallestvalueToSearch) && SmallestvalueToSearch!=X)
					{
						set.add(SmallestvalueToSearch);
						SmallestvalueToSearch++;
						steps++;
					}
				else if(SmallestvalueToSearch == X)
					{
						break;
					}
			}
			System.out.println(steps);
	}
}

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int a[]=new int[n];
		int k=scan.nextInt();
		int m=0;
		for(int i=0;i<n;i++){
			a[i]=scan.nextInt();
			if(a[i]<=0) m++;
		}
		System.out.println(k>m?k-m:0);
	}
}

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int curr = -1;
        int next;
        int sum = 0;
        for(int i = 0 ; i< n ; i++){
            next = sc.nextInt();
            if(next < x){
                sum += next-curr-1;
                curr = next;
            }
            else if(next > x){
                sum += x - curr - 1;
                break;
            }
            else{
                sum += x - curr;
                break;
            }
        }
        if(curr < x){
            sum += x - curr-1;
        }
        System.out.println(sum);
    }
}

import java.util.*;
public class bob {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int x = in.nextInt();
        int[] arr = new int[n];
        for(int i = 0; i < n; i++) {
            arr[i] = in.nextInt();
        }
        Arrays.sort(arr);
        if(x == 0 && arr[0] == 0) {
            System.out.println(1);
            return;
        } else if(x == 0 && arr[0] != 0) {
            System.out.println(0);
            return;
        }
        int valuesBelowX = 0;
        for(int i = 0; i < n; i++) {
            int curr = arr[i];
            if(curr < x) {
                valuesBelowX++;
            } else {
                break;
            }
        }

        System.out.println(x - valuesBelowX);

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;

import java.lang.management.MemoryType;
import java.math.BigInteger;
import java.util.*;

public class Main {

        public static void main (String[]args) throws IOException {
        Scanner in = new Scanner(System.in);
        try(PrintWriter or = new PrintWriter(System.out)){

           int n = in.nextInt(),x=in.nextInt();
          PriorityQueue<Integer>a= new PriorityQueue<>();

            for (int i = 0; i <n ; i++) {
                a.offer(in.nextInt());
            }

            Integer ans=-1;
            List<Integer>set= new ArrayList<>();
            for (int i = 0; i <=x; i++) {
                if (!a.contains(i)){
                    if (ans==-1)ans=i;
                    set.add(i);
                }
            }
            if (ans==-1){
                if (a.contains(x))or.print(1);
                else or.print(0);
            }else{
                if (ans==x)or.print(1);
              else   or.print(set.size()-1);
            }

        }

    }

    static class Scanner {

        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

    }
}

class prog {

    int skill;
    int indx;
    int pp;

    public prog(int skill, int indx) {
        this.skill = skill;
        this.indx = indx;
        pp = 0;
    }

    @Override
    public String toString() {
        return "prog{" + "skill=" + skill + ", indx=" + indx + ", pp=" + pp + '}';
    }

}

import java.io.*;
import java.util.StringTokenizer;

public class R435C {

    FastScanner sc;
    PrintWriter out;

    final int pw1 = (1<<17);
    final int pw2 = (1<<18);
    int n, x;

    public void solve()  {
        n = sc.nextInt();
        x = sc.nextInt();

        if (n == 1) {
            System.out.println("YES");
            System.out.println(x);
            return;
        }

        if (n==2 && x==0) {
            System.out.println("NO");
            return;
        }
        if (n == 2) {
            System.out.println("YES");
            System.out.println(x);
            return;
        }

        int res = 0;
        System.out.println("YES");
        for (int i=1; i<=n-3; i++) {
            System.out.print(i + " ");
            res ^= i;
        }

        if (res == x) {
            int a = pw1 + pw2;
            int b = pw1;
            int c = pw2;
            System.out.println(a + " " + b + " " + c);
        } else {
            int a = pw1;
            int b = ((pw1^x)^res);
            int c = 0;
            System.out.println(a + " " + b + " " + c);
        }

    }

    private void run() {
       //sc = new FastScanner(new File("input.txt"));
         sc = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();
        out.close();
    }

    public static void main(String[] args) {
        new R435C().run();
    }

    private class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

//package a.codeforces.rating;

import java.util.*;
import java.io.*;
import static java.lang.Math.*;
import java.math.BigInteger;
public class Main {

   //static ArrayList<Integer> a = new ArrayList();
    public static void main(String[] args) {

        FastReader in = new FastReader();
        StringBuilder out =new StringBuilder();
         int n = in.nextInt();
         int x = in.nextInt();
         int [] set = new int[n];
         for (int i = 0; i <set.length; i++) {
            set[i]=in.nextInt();
        }
         int c = 0,r=0;
         boolean b= false,t=false;
         ArrayList<Integer> a = new ArrayList();
         for (int i = 0; i < set.length; i++) {
            if(set[i]<x){
                a.add(set[i]);
                c=a.size();
                b=true;
            }else if(set[i]==x){
                c++;
            }else if(set[i]>x&&!b){
                t=true;
                if(r<x)
                r++;
            }
        }

         if(b)
         System.out.println(x-c);
         else if(t)
             System.out.println(r);
         else
             System.out.println(c);
    }

}

class FastReader {

    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }
}

import java.util.*;
import java.lang.*;
import java.io.*;

public class Codechef
{

	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int x=sc.nextInt();
		int[] arr=new int[n];
		for(int i=0;i<n;i++)
		{
		arr[i]=sc.nextInt();
		}
		Arrays.sort(arr);

		for(int i=0;i<n;i++)
		System.out.print(arr[i]+" ");
		System.out.println();
		int number=0;
		int operation=0;
		int i=0;
		while(number!=x && i<n)
		{
		    if(arr[i]!=number)
		    {
		        number++;
		        operation++;
		    }
		    else if(arr[i]==number)
		    {
		    i++;
		    number++;
		    }
		}
		if(i<n && number==x && arr[i]==x)
		operation++;

		if(number!=x && i==n-1)
		{
		    while(number!=x)
		    number++;
		}
		System.out.println(operation);

	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (PloadyFree@gmail.com)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            int x = in.readInt();
            int[] count = new int[102];
            for (int i = 0; i < n; i++) {
                count[in.readInt()]++;
            }
            int mex = 0;
            while (count[mex] > 0) {
                mex++;
            }
            if (mex < x) {
                out.print(x - mex);
            } else {
                int ans = 0;
                while (--mex >= x) {
                    ans += count[mex];
                }
                out.print(ans);
            }
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void print(int i) {
            writer.print(i);
        }

    }
}

import java.util.*;
public class Oheduniya {

    public static void main(String[] args) {
        Set<Integer> st;
        st = new HashSet<>();
        int n, m;
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        m = in.nextInt();
        int ara[] = new int[n];
        for(int i = 0; i<n; i++)
        {
            ara[i] = in.nextInt();
            st.add(ara[i]);
        }
        int cnt = 0;
        for(int i = 0; i<m; i++)
        {
            if(st.contains(i)==false) cnt++;
        }
        if(cnt==0 && st.contains(m)==true) cnt++;
        System.out.println(cnt);
    }

}

import java.util.Scanner;

public class Evil {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {
        int quantity = Evil.quantity();
        int MEX = Evil.MEX();
        int[] massif = Evil.massif(quantity);
        int decision = Evil.decision(quantity, MEX, massif);
        System.out.println(decision);

    }

    public static int quantity() {
        int quantity = scanner.nextInt();
        return quantity;
    }

    public static int MEX() {
        int MEX = scanner.nextInt();
        return MEX;
    }

    public static int[] massif(int quantity) {
        int[] massif = new int[quantity];
        for (int i = 0; i < quantity; i++) {
            massif[i] = scanner.nextInt();
        }
        return massif;
    }

    public static int decision(int quantity, int MEX, int[] massif) {
        int result=0;
        int max = 0;
        for (int i = 0; i < quantity; i++) {
            if (massif[i]<MEX){
                result++;
            }
        }
        for (int i = 0; i < quantity; i++) {
            if (massif[i]>max){
                max=massif[i];
            }
        }

        if (max>MEX) {
            result = MEX - result;
            for (int i = 0; i < quantity; i++) {
                if (massif[i]==MEX){
                    result++;
                }
            }
        }else result=0;

        return result;
    }
}

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Solution
{
    public static double eps = 1e-9;

    public static int gcd(int a, int b)
    {
        if (b == 0) return a; else
            return gcd(b, a % b);
    }

    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        int x = in.nextInt();

        int[] t = new int[n];

        for (int i = 0; i < n; i++) t[i] = in.nextInt();

        Arrays.sort(t);

        int xx = -1;
        int index = 0;

        if (x == 0) {

            if (t[0] == 0) System.out.println(1); else
                System.out.println(0);

            return;

        }

        for (int i = 0; i < n; i++)
            if (t[i] < x && t[i] > xx) { xx = t[i]; index = i; }

        int sol = x - xx - 1;

        if (index + 1 < t.length && t[index + 1] == x) sol++;

        System.out.println(sol);
    }

    public static class Pair<T, K>
    {
        public T key1;
        public K key2;

        public Pair()
        {

        }

        public Pair(T key1, K key2)
        {
            this.key1 = key1;
            this.key2 = key2;
        }
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;

import java.lang.management.MemoryType;
import java.math.BigInteger;
import java.util.*;

public class Main {

        public static void main (String[]args) throws IOException {
        Scanner in = new Scanner(System.in);
        try(PrintWriter or = new PrintWriter(System.out)){

           int n = in.nextInt(),x=in.nextInt();
          PriorityQueue<Integer>a= new PriorityQueue<>();

            for (int i = 0; i <n ; i++) {
                a.offer(in.nextInt());
            }

            Integer ans=-1;
            List<Integer>set= new ArrayList<>();
            for (int i = 0; i <=x; i++) {
                if (!a.contains(i)){
                    if (ans==-1)ans=i;
                    set.add(i);
                }
            }
            if (ans==-1){
                or.print(1);
            }else{
                if (ans==x)or.print(1);
              else   or.print(set.size()-1);
            }

        }

    }

    static class Scanner {

        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

    }
}

class prog {

    int skill;
    int indx;
    int pp;

    public prog(int skill, int indx) {
        this.skill = skill;
        this.indx = indx;
        pp = 0;
    }

    @Override
    public String toString() {
        return "prog{" + "skill=" + skill + ", indx=" + indx + ", pp=" + pp + '}';
    }

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.stream.Stream;

public class Main {

    public static void main(String[] args) {

        FastReader in = new FastReader();

        int n=in.nextInt();

        int mex=in.nextInt();

        int[]x=new int[n];

        boolean[]vis=new boolean[110];

        int max=0;

        for (int i=0;i<n;i++){
            x[i]=in.nextInt();
            vis[x[i]]=true;
            max=x[i]>max?x[i]:max;
        }

        int countOperation=0;

        for(int i=0;i<=max;i++){
            int a=i;

            if(i == mex){
                if(vis[i]){
                  countOperation++;
                }
                break;
            } else if(!vis[i]){
                countOperation++;
            }
        }

        System.out.println(countOperation);

    }

}

class FastReader {

    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }
}

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package codeforces;
import java.util.*;
/**
 *
 * @author Ashraf
 */
public class DVA1 {
    public static void main(String []args){
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int x=in.nextInt();
        int ara[]=new int[1000];
        int max=-1,min=200;
        boolean bool[]=new boolean[1000];
        for(int i=1;i<=n;i++){
            ara[i]=in.nextInt();
        }
        if(x==0){
            if(n==1){
                System.out.println(1);
            }
            else{
                System.out.println(x);
            }
        }
        else{
            System.out.println(x-1);
        }

    }
}

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.util.*;
import java.io.*;

/**
 *
 * @author rahul kumar
 */
public class Main {

    public static void main(String[] args)throws IOException {
     BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
     String s[]=in.readLine().split(" ");
     int n=Integer.parseInt(s[0]);
     int x=Integer.parseInt(s[1]);
     String ss=in.readLine();
     String sss[]=ss.split(" ");
     int count=0;
     String a=Integer.toString(x);
     if(ss.contains(a)){
         count++;
     }
     for(int i=0;i<x;i++){
         String b=Integer.toString(i);
         if(!ss.contains(b)){
             count++;
         }
     }
    System.out.println(count) ;
    }
}

import java.util.*;
public class A862
{
    public static void main(String...arg)
    {
        int x,n,c=0,c1=0,c2=0,i,j,k;
        Scanner sc=new Scanner(System.in);
        n=sc.nextInt();
        x=sc.nextInt();
        int a[]=new int[n];
        for(i=0;i<n;i++)
        {
            a[i]=sc.nextInt();
        }
        j=0;
        for (i=0;i<x;i++)
        {
            if (a[j]!=i)
            {
                c++;
            }
            else
            j++;
        }
        c=(a[j]==x)?c:c++;
        System.out.println(c);
    }
}

/**
 * DA-IICT
 * Author : PARTH PATEL
 */
import java.io.*;
import java.math.*;
import java.util.*;

import static java.util.Arrays.fill;
import static java.lang.Math.*;
import static java.util.Arrays.sort;
import static java.util.Collections.sort;

public class MahmoudandEhabandtheMEX
{

	public static int mod = 1000000007;
	static FasterScanner in = new FasterScanner();
	static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args)
	{

		int n=in.nextInt();
		int x=in.nextInt();
		int[] arr=in.nextIntArray(n);
		Arrays.sort(arr);
		int answer=0;
		int temp=0;
		int count=0;
		for(int i=0;i<n;i++)
		{
			if(arr[i]<x)
				count++;
			if(arr[i]==x)
				answer=1;
		}
		answer+=Math.max(0, x-count);
		out.close();

	}

	public static long pow(long x, long n, long mod)
	{
		long res = 1;
		for (long p = x; n > 0; n >>= 1, p = (p * p) % mod)
		{
			if ((n & 1) != 0)
			{
				res = (res * p % mod);
			}
		}
		return res;
	}

	public static long gcd(long n1, long n2)
	{
		long r;
		while (n2 != 0)
		{
			r = n1 % n2;
			n1 = n2;
			n2 = r;
		}
		return n1;
	}

	static class FasterScanner
	{
		private byte[] buf = new byte[1024];
		private int curChar;
		private int snumChars;

		public int read()
		{
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try
				{
					snumChars = System.in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public String nextString()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public long nextLong()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int nextInt()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n)
		{
			int[] arr = new int[n];
			for (int i = 0; i < n; i++)
			{
				arr[i] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray(int n)
		{
			long[] arr = new long[n];
			for (int i = 0; i < n; i++)
			{
				arr[i] = nextLong();
			}
			return arr;
		}

		private boolean isSpaceChar(int c)
		{
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c)
		{
			return c == '\n' || c == '\r' || c == -1;
		}
	}

}

import java.util.Scanner;

public class MainActivity {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt(), x = scanner.nextInt();

		int min = Integer.MAX_VALUE, numbers = 1;

		for (int i = 0, m = 0; i < n; i++) {
			m = scanner.nextInt();

			if (m > x && m < min)
				min = m;

			if (m < x) numbers++;
		}

		if (min == Integer.MAX_VALUE)
			min = 0;

		System.out.println(Math.abs(min - numbers));
	}
}

/*
 * Author Ayub Subhaniya
 * Institute DA-IICT
 */

import java.io.*;
import java.util.*;

public class Codeforces429A
{

	InputStream in;
	PrintWriter out;

	void solve()
	{
		int n=ni();
		int x=ni();
		boolean present[]=new boolean[102];
		for (int i=0;i<n;i++)
			present[ni()]=true;
		int mex=0;
		while (present[mex])
			mex++;
		if (mex==x)
		{
			out.println(0);
		}
		else if (mex>x)
		{
			out.println(mex-x);
		}
		else
		{
			out.println(x-mex);
		}
	}

	void run() throws Exception
	{
		String INPUT = "C:/Users/ayubs/Desktop/input.txt";
		in = oj ? System.in : new FileInputStream(INPUT);
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis() - s + "ms");

	}
	public static void main(String[] args) throws Exception
	{
		new Codeforces429A().run();
	}

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf)
		{
			ptrbuf = 0;
			try
			{
				lenbuf = in.read(inbuf);
			}
			catch (IOException e)
			{
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean inSpaceChar(int c)
	{
		return !(c >= 33 && c <= 126);
	}

	private int skip()
	{
		int b;
		while ((b = readByte()) != -1 && inSpaceChar(b))
			;
		return b;
	}

	private double nd()
	{
		return Double.parseDouble(ns());
	}

	private char nc()
	{
		return (char) skip();
	}

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(inSpaceChar(b)))
		{ // when nextLine, (inSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(inSpaceChar(b)))
		{
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-')
		{
			minus = true;
			b = readByte();
		}

		while (true)
		{
			if (b >= '0' && b <= '9')
			{
				num = num * 10 + (b - '0');
			}
			else
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-')
		{
			minus = true;
			b = readByte();
		}

		while (true)
		{
			if (b >= '0' && b <= '9')
			{
				num = num * 10 + (b - '0');
			}
			else
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

	private void tr(Object... o)
	{
		if (!oj)
			System.out.println(Arrays.deepToString(o));
	}

}

import java.util.ArrayList;
import java.util.Scanner;

public class EvilSet {

	public static void main(String[] args)
	{
		Scanner inp=new Scanner(System.in);
		int n=inp.nextInt();
		int x=inp.nextInt();

		ArrayList<Integer> set=new ArrayList<>();
		for(int i=0;i<n;i++)
		{
			set.add(inp.nextInt());
		}
		int o=findOper(set,x);
		System.out.println(o);
		inp.close();
	}

	private static int findOper(ArrayList<Integer> set, int x)
	{

		int i=0,flag=0;
		int count=0;
		while(set.get(i)<x)
		{
			count++;
			i++;
		}
		if(set.get(i)==x)
		{
			flag=1;
		}
		return count-x+flag;
	}

}

import java.util.HashSet;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        HashSet<Integer> hs = new HashSet<>();
        for(int i=0;i<n;i++)
            hs.add(sc.nextInt());
        int moves=0;
        if(hs.contains(x))
            moves++;
        for(int j=0;j<x;j++)
            if(!hs.contains(x))
                moves++;
        System.out.println(moves);
    }

}

import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class R435A {

    FastScanner sc;
    PrintWriter out;

    int n;
    int X;
    int[] arr;

    static int mex(int x, int[] arr) {

        if (x == 0 && arr[0]==0 && arr.length == 1) {
            return -1;
        }
        int res = 0;
        Arrays.sort(arr);

        int maxx = arr[arr.length-1];
        int minn = arr[0];

        // left
        if (x > maxx)  {
            res = maxx+1;
            return res;
        }
        // right
        if (x < minn)  {
            res = minn-1;
            return res;
        }
        // inside
        // res = (x - arr[0])-1;

        for (int i=1; i<arr.length; i++) {

            int diff = arr[i] - arr[i-1];
            //System.out.println("diff" + diff);
            if (diff > 1) {
                res = (arr[i-1])+1;
                break;
            }

        }

        return res;
    }

    static int hello(int x, int[] arr) {
        int a = 0;
        Arrays.sort(arr);
        for (int i=1; i<arr.length; i++) {

            int diff = arr[i] - arr[i-1];
            if (diff > 1) {
                a = (x - arr[i-1])-1;
                break;
            }

        }

        return a;
    }

    public void solve()  {
        n = sc.nextInt();
        X = sc.nextInt();
        arr = new int[n];
        for (int i=0; i<n; i++) {
            arr[i] = sc.nextInt();
        }

        // cost=0
        // when already equal to x
        if (mex(X, arr) == X) {
            out.println(0);
            return;
        }

        if (mex(X, arr) == -1) {
            out.println(1);
            return;
        }

        // cost=1
        // when need to delete
        if (X == 0 && arr[0] == 0) {
            System.out.println(1);
            return;
        }

        Arrays.sort(arr);

        // COST=1
        int maxx = arr[arr.length-1];
        int minn = arr[0];
        // right case
        if (X > maxx)  {
            System.out.println(maxx+1);
            return;
        }

        // left case
        if (X < minn) {
            System.out.println(minn-1);
            return;
        }

        // when in middle
        out.println(hello(X, arr));

    }

    private void run() {
      // sc = new FastScanner(new File("input.txt"));
        sc = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();
        out.close();
    }

    public static void main(String[] args) {
        new R435A().run();
    }

    private class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

import java.util.Arrays;
import java.util.Scanner;

public class Codechef {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt(), x = input.nextInt(), c = 0, c1 = 0;
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = input.nextInt();
        }
        Arrays.sort(a);
        for (int i = 0; i < x; i++) {
            for (int j = 0; j <x; j++) {
                if(a[j]==i){
                    c++;
                }
            }
        }

        for (int i = 0; i <n; i++) {
            if(a[i]==x){
                c1++;
            }
        }
      if(c1==0){
          System.out.println(x-c);
      }else{
          System.out.println(c+c1);
      }

    }

}

//package com.company;

import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    int n = sc.nextInt();
	    int x = sc.nextInt();
	    int c[] = new int[n];
	    for(int i=0;i<n;i++)
	    	c[i] = sc.nextInt();
	    Arrays.sort(c);
	    if(x<c[0]){
	    	System.out.println(0);
	    	System.exit(0);
		}
	    if(x==c[0]){
			System.out.println(1);
			System.exit(0);
		}
	    int i=0,j=i+1;
	    int count=0;
	    while(j<n && c[j]<=x){
	    	count+=c[j]-c[i]-1;
	    	j++;
	    	i++;
		}
		if(c[j]==x)
			count++;
		count+=x-c[i]-1;
		System.out.println(count);
    }
}

import java.util.Arrays;
import java.util.Scanner;
import java.io.PrintWriter;

public class P862A_Mahmoud_and_Ehab_and_the_MEX {

/* the MEX of the set {0, 2, 4} is 1 and the MEX of the set {1, 2, 3} is 0 .
 * Category: Implementation
 * 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
input
1 50
0
output
49
input
2 50
1 100
output
49
 */
	private Scanner in = new Scanner(System.in);
	private PrintWriter pw = new PrintWriter(System.out);

	public static void main(String[] args) {
		(new P862A_Mahmoud_and_Ehab_and_the_MEX()).solve();
	}

	public void solve() {
		int n = in.nextInt();
		int x = in.nextInt();

		int[] A = new int[n];
		int answer = 0, r = 0, i;
		int nInsertions;

		for (i = 0; i < n; i++) {
			A[i] = in.nextInt();
		}

		Arrays.sort(A);

		for (i = 0; i < n && A[i] < x; i++) {
			nInsertions = A[i] - r;
		    if (nInsertions > 0) {
		        answer += nInsertions;
		    }

		    r = A[i] + 1;
		}

	    if (i < n && A[i] == x) {
			answer++;
		} else {
			nInsertions = x - r;
		    if (nInsertions > 0) {
		        answer += nInsertions;
			}
		}

		pw.printf("%d\n", answer);
		pw.flush();
	}
}

import java.util.HashMap;
import java.util.Scanner;
public class Main
 {
    public static void main(String[] args)
    {
        Scanner sc=new Scanner(System.in);
         int n=sc.nextInt();
         int k=sc.nextInt();
         int max=0;
         HashMap<Integer,Boolean> hash=new HashMap<>();
   for(int i=0;i<=k;i++)
       hash.put(i, false);
         for(int i=0;i<n;i++)
         {
         int a=sc.nextInt();
        if(max<a)
            max=a;
         hash.put(a,true);
         }
         int count=0;
          for(int i=1;i<k;i++)
          {
              if(!hash.get(i))
                  count++;
          }
          if(!hash.get(0))
              count++;
          if(hash.get(k))
              count++;
          System.out.println(count);
              }
}

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int a[]=new int[n];
		int k=scan.nextInt();
		int m=0;
		for(int i=0;i<n;i++){
			a[i]=scan.nextInt();
			if(a[i]<=0) m++;
		}
		System.out.println(k>m?k-m:0);
	}
}

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int x = scanner.nextInt();
        int arr[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }
        Arrays.sort(arr);
        int mex = -1;
        for (int i = 0; i < n; i++) {
            if (i != arr[i]) {
                mex = i;
                break;
            }
        }
        if (mex == -1){
            mex = arr[n - 1] + 1;
        }
        int test_arr[] = new int [101];
        Arrays.fill(test_arr,0);
        for (int i = 0; i < n; i++) {
            test_arr[arr[i]]++;
        }
        int sum = 0;
        for (int i = 0; i < x -1 ; i++) {
            sum += test_arr[i];
        }
        if (mex > x){
            System.out.println(1);
        }else if (mex == x){
            System.out.println(0);
        }else {
            System.out.println(x - sum);
        }
    }
}

import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class R435A {

    FastScanner sc;
    PrintWriter out;

    int n;
    int X;
    int[] arr;

    static int mex(int x, int[] arr) {
        int res = 0;
        Arrays.sort(arr);

        int maxx = arr[arr.length-1];
        int minn = arr[0];

        // left
        if (x > maxx)  {
            res = maxx+1;
            return res;
        }
        // right
        if (x < minn)  {
            res = minn-1;
            return res;
        }
        // inside
        // res = (x - arr[0])-1;

        for (int i=1; i<arr.length; i++) {

            int diff = arr[i] - arr[i-1];
            //System.out.println("diff" + diff);
            if (diff > 1) {
                res = (arr[i-1])+1;
                break;
            }

        }

        return res;
    }

    static int hello(int x, int[] arr) {
        int a = 0;
        Arrays.sort(arr);
        for (int i=1; i<arr.length; i++) {

            int diff = arr[i] - arr[i-1];
            if (diff > 1) {
                a = (x - arr[i-1])-1;
                break;
            }

        }

        return a;
    }

    public void solve()  {
        n = sc.nextInt();
        X = sc.nextInt();
        arr = new int[n];
        for (int i=0; i<n; i++) {
            arr[i] = sc.nextInt();
        }
        if (n == 1) {
            System.out.println(1);
            return;
        }

        // when already equal to x
        if (mex(X, arr) == X) {
            out.println(0);
            return;
        }

        // when need to delete
        if (X == 0 && arr[0] == 0) {
            System.out.println(1);
            return;
        }

        Arrays.sort(arr);

        int maxx = arr[arr.length-1];
        int minn = arr[0];
        // right case
        if (X > maxx)  {
            System.out.println(maxx+1);
            return;
        }

        // left case
        if (X < minn) {
            System.out.println(minn-1);
            return;
        }

        // when in middle
        out.println(hello(X, arr));

    }

    private void run() {
      // sc = new FastScanner(new File("input.txt"));
        sc = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();
        out.close();
    }

    public static void main(String[] args) {
        new R435A().run();
    }

    private class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

import java.util.Scanner;

public class A {
public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int n = scan.nextInt();
	int req = scan.nextInt();
	int[] arr = new int[n];
	int MEX = -1;
	for(int i= 0 ;i<arr.length;i++)
	{
		arr[i] = scan.nextInt();
	}
	boolean[] flags = new boolean[arr[n-1]+1];
	for(int i = 0 ;i<flags.length;i++)
	{
		for(int k = 0;k<arr.length;k++)
		{
			if(i==arr[k]){
				flags[i] = true;
				break;
			}
		}
	}

	for(int i = 0 ; i < flags.length ; ++i)
	{
		if(!flags[i]){
			MEX = i;
			break;
		}
	}

	if(MEX==-1)
	{
//		System.out.println(MEX);
		System.out.println(req<flags.length?"1":req-(arr[n-1]+1));
	}
	else{
	int count = 0 ;
	if(req<=arr[n-1]){
	if(flags[req])
		count =1;
	for(int i = MEX;i<req;i++)
	{
		if(!flags[i])
			count++;
		}

	}else{
		for(int i = MEX;i<flags.length;i++)
		{
			if(!flags[i])
				count++;
		}
		count+=(req-arr[n-1]);
	}
//	System.out.println(MEX);
	System.out.println(count);

}
}
}

import java.util.*;
import java.io.*;
import java.math.BigInteger;

public class tr0 {
	static PrintWriter out;
	static StringBuilder sb;
	static int mod = (int) 1e9 + 7;
	static int inf = (int) 1e8;
	static long[] val;
	static int n, q, k;
	static int[] ad;
	static int[] ans;
	static long[] memo;
	static ArrayList<Integer> h;
	static char[][] grid;
	static int[] t, deg;
	static boolean vis[];

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n=sc.nextInt();
		int x=sc.nextInt();
		int ans=0;
		int less=0;
		for(int i=0;i<n;i++)
			if(sc.nextInt()<x)
				less++;
		out.print(x-less);
		out.flush();
	}
	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public int[] nextArrInt(int n) throws IOException {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long[] nextArrLong(int n) throws IOException {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}

/**
 * @(#)dfvs.java
 *
 * dfvs application
 *
 * @author
 * @version 1.00 2017/11/28
 */
import java.util.*;

public class JavaApplication7 {

    public static void main(String[] args) {
        bus();
    }
    public static long bus(){
        Scanner kbd = new Scanner(System.in);
        long a = kbd.nextLong();
        long b = kbd.nextLong();
        long f = kbd.nextLong();
        long k = kbd.nextLong();

        // no need to refuel at all
        if (b >= a * k) {
            System.out.print(0);
            System.out.print("\n");
            return 0;
        }

        // impossible
        if (b < 2 * f || b < 2 * a - 2 * f) {
            System.out.print(-1);
            System.out.print("\n");
            return 0;
        }

        if (k == 1 && b < a) {
            System.out.print(1);
            System.out.print("\n");
            return 0;
        }

        long bc = b;
        long min = 0;

        for (int i = 0; i < k; ++i) {
            if (i % 2 == 0) {
                if (bc < f) {
                    ++min;
                    bc = b - f;
                }

                if (bc < a) {
                    ++min;
                    bc = b - (a - f);
                } else {
                    bc = b - a;
                }
            } else {
                if (bc < a - f) {
                    ++min;
                    bc = b - (a - f);
                }

                if (bc < a) {
                    ++min;
                    bc = b - f;
                } else {
                    bc = b - a;
                }
            }
        }

        System.out.print(min);
        System.out.print("\n");
        return 0;

    }
    }

import java.util.*;
public class One {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int ar[] = new int[n];
        for (int i = 0; i < n; i++){
            ar[i] = sc.nextInt();
        }
        System.out.println(F(ar,n,x));
    }
    public static int F(int ar[], int n, int x) {
        int count = 0;
        if (ar[0] == x) count += x+1;
        else {
            if (ar[0] < x) count += ar[0];
            for (int i = 1; i < n; i++) {
                if (ar[i] < x) {
                    count += ar[i] - ar[i - 1] - 1;
                } else if (ar[i] == x) {
                    count++;
                    break;
                } else {
                    count += x - ar[i - 1] - 1;
                    break;
                }
            }
        }
        return count;
    }

}

import java.util.*;

public class CF435ProblemA {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int x = sc.nextInt();
		int[] ar = new int[n];
		int count = 0;

		for (int i = 0; i < n; i++) {
			ar[i] = sc.nextInt();
			if (i > 0) {
				if (x > ar[i-1]) {
					if (x > ar[i]) {
						// gets the number in between for example, if x > 5 but
						// ar[1] = 2 and ar[2] = 5
						count = count + (ar[i] - ar[i-1] -1);
					} else if (x < ar[i]) {
						count += (x - ar[i-1] - 1);
					} else if (x == ar[i]) {
						count += (x - ar[i-1]);
					}

				}
			} else {
				if (x == ar[i]) {
					count = x + 1;
					break;
				} if (x > ar[i]) {
					count += ar[i];
				}
			}

		}

		System.out.println(count);

		//		int mex;
		//		int last = 0;
		//		int step;
		//
		//		for (int i = 0; i < n; i++) {
		//			ar[i] = sc.nextInt();
		//			if (ar[i] != i) {
		//				mex = i;
		//				if (mex == x) {
		//					break;
		//				}
		//			}
		//			if ((ar[i] - last) > 1) {
		//				step = ar[i] - last;
		//				if (x <= step + ar[i]) {
		//
		//				}
		//			}
		//			last = ar[i];
		//		}
		//
		//		System.out.println(count);
		//

	}

}

import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;

import static java.lang.Math.*;

public class Main implements Runnable {
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                }
                catch (IOException e) {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt() {
            int c = read();

            while(isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do {
                if(c<'0'||c>'9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
                return res * sgn;
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));

            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next() {
            return readString();
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
    public static void main(String args[]) throws Exception {
        new Thread(null, new Main(),"Main",1<<26).start();
    }

    static void merge(int arr[], int l, int m, int r) {
        int n1 = m - l + 1;
        int n2 = r - m;
        int L[] = new int [n1];
        int R[] = new int [n2];
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];
        int i = 0, j = 0;
        int k = l;
        while (i < n1 && j < n2){
            if (L[i] <= R[j]){
                arr[k] = L[i];
                i++;
            }
            else{
                arr[k] = R[j];
                j++;
            }
            k++;
        }
        while (i < n1){
            arr[k] = L[i];
            i++;
            k++;
        }
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }
    static void sort(int arr[], int l, int r) {
        if (l < r)
        {
            int m = (l+r)/2;
            sort(arr, l, m);
            sort(arr , m+1, r);
            merge(arr, l, m, r);
        }
    }

    static void mergel(long arr[], int l, int m, int r) {
        int n1 = m - l + 1;
        int n2 = r - m;
        long L[] = new long [n1];
        long R[] = new long [n2];
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];
        int i = 0, j = 0;
        int k = l;
        while (i < n1 && j < n2){
            if (L[i] <= R[j]){
                arr[k] = L[i];
                i++;
            }
            else{
                arr[k] = R[j];
                j++;
            }
            k++;
        }
        while (i < n1){
            arr[k] = L[i];
            i++;
            k++;
        }
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }
    static void sortl(long arr[], int l, int r) {
        if (l < r)
        {
            int m = (l+r)/2;
            sortl(arr, l, m);
            sortl(arr , m+1, r);
            mergel(arr, l, m, r);
        }
    }

    public void run() {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n=in.nextInt(),x=in.nextInt();

        int arr[]=new int[n];
        for(int i=0;i<n;i++)
            arr[i]=in.nextInt();
        Arrays.sort(arr);
        int op=0,i;
        for(i=0;i<x;i++){
            if(arr[i]!=i)
                op++;
        }
        if(arr[i]==x)
            op++;
        out.print(op);

        out.close();
    }
}

import java.util.Scanner;

public class Task_292A {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), x = sc.nextInt();
		int a[] = new int [n + 1];
		int cnt[] = new int [1001];
		for(int i = 1; i <= n; i ++)
			a[i] = sc.nextInt();
		int mn = 0;
		for(int i = 1; i <= n; i ++) {
			cnt[a[i]] ++;
		}
		int t = 0;
		for(int i = 0; i < x; i ++) {
			if(cnt[i] == 0) {
				t ++;
			}
		}
		if(t > 0) {
			System.out.println(t);
		}
		else {
			if(cnt[x] == 0)
				System.out.println(0);
			else
				System.out.println(1);
		}
	}
}

import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class R435A {

    FastScanner sc;
    PrintWriter out;

    int n;
    int X;
    int[] arr;

    static int mex(int x, int[] arr) {

        if (x == 0 && arr[0]==0 && arr.length == 1) {
            return -1;
        }
        int res = 0;
        Arrays.sort(arr);

        int maxx = arr[arr.length-1];
        int minn = arr[0];

        // left
        if (x > maxx)  {
            res = maxx+1;
            return res;
        }
        // right
        if (x < minn)  {
            res = minn-1;
            return res;
        }
        // inside
        // res = (x - arr[0])-1;

        for (int i=1; i<arr.length; i++) {

            int diff = arr[i] - arr[i-1];
            //System.out.println("diff" + diff);
            if (diff > 1) {
                res = (arr[i-1])+1;
                break;
            }

        }

        return res;
    }

    static int hello(int x, int[] arr) {
        int a = 0;
        Arrays.sort(arr);
        for (int i=1; i<arr.length; i++) {

            int diff = arr[i] - arr[i-1];
            if (diff > 1) {
                a = (x - arr[i-1])-1;
                break;
            }

        }

        return a;
    }

    public void solve()  {
        n = sc.nextInt();
        X = sc.nextInt();
        arr = new int[n];
        for (int i=0; i<n; i++) {
            arr[i] = sc.nextInt();
        }

        // cost=0
        // when already equal to x
        if (mex(X, arr) == X) {
            out.println(0);
            return;
        }

        // cost=1
        // when need to delete
        if (X == 0 && arr[0] == 0) {
            System.out.println(1);
            return;
        }

        Arrays.sort(arr);

        // COST=1
        int maxx = arr[arr.length-1];
        int minn = arr[0];
        // right case
        if (X > maxx)  {
            System.out.println(maxx+1);
            return;
        }

        // left case
        if (X < minn) {
            System.out.println(minn-1);
            return;
        }

        // when in middle
        out.println(hello(X, arr));

    }

    private void run() {
      // sc = new FastScanner(new File("input.txt"));
        sc = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();
        out.close();
    }

    public static void main(String[] args) {
        new R435A().run();
    }

    private class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

import java.util.Scanner;
/**
 *
 * @author sokolovfedor
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int x = in.nextInt();
        int otvet = 0;
        int array[] = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = in.nextInt();
        }
        for (int c = 0; c < n; c++) {
            for (int i = 0; i < n - 1; i++) {
                int a = 0;
                int b = 0;
                if (array[i] > array[i + 1]) {
                    a = array[i + 1];
                    array[i + 1] = array[i];
                    array[i] = array[i + 1];
                }
            }
        }
        for (int i = 0; i < x; i++) {
            for (int c = 0; c < n; c++) {
                if (i == array[c]) {
                    otvet++;
                }
            }

        }
        for (int i = 0; i < n; i++) {
        if(array[i] == x){
        otvet = otvet - 1;
        }
        }
        System.out.println(x - otvet);
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.stream.Stream;

public class Main {

    public static void main(String[] args) {

        FastReader in = new FastReader();

        int n=in.nextInt();

        int mex=in.nextInt();

        int[]x=new int[n];

        boolean[]vis=new boolean[110];

        int max=0;

        for (int i=0;i<n;i++){
            x[i]=in.nextInt();
            vis[x[i]]=true;
            max=x[i]>max?x[i]:max;
        }

        int countOperation=0;

        for(int i=0;i<=max;i++){
            int a=i;

            if(i == mex){
                if(vis[i]){
                  countOperation++;
                }
            } else if(!vis[i]){
                countOperation++;
            }
        }

        System.out.println(countOperation);

    }

}

class FastReader {

    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }
}

//Original version of merge sort. This does not incorporate the concept of sentinel card.
import java.util.*;
public class cforcesq1
{
    int arr[];
    public cforcesq1(int n)
    {
        arr = new int[n];
    }
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        cforcesq1 obj = new cforcesq1(n);
        int x = sc.nextInt();
        for(int i=0;i<n;i++)
        {
            obj.arr[i] = sc.nextInt();
        }
        obj.merge(obj.arr,0,n-1);
        obj.find_mex(x);
    }
    void find_mex(int m)
    {
        if(arr[0]>m)
        {
            System.out.println(m);
        }
        else
        {
            for(int i=0;i<arr.length;i++)
            {
                if(arr[i]>m)
                {
                    System.out.println(m-i);
                    break;
                }
                else if(arr[i]==m)
                {
                    System.out.println(i+1);
                    break;
                }
            }
        }
    }
    void merge(int[] a, int p, int r)
    {
        if(p<r)
        {
            int q=(p+r)/2;
            merge(a, p, q);
            merge(a, q+1, r);
            m(a, p, q, r);
        }
    }
    void m(int[] a, int j, int k, int l)
    {
        if(a[k]>a[k+1]){
        int x[]=new int[k-j+2];
        int y[]=new int[l-k+1];
        for(int i=j; i<=l; i++)
        {
            if(i<=k)
                x[i-j]=a[i];
            else
                y[i-k-1]=a[i];
            }
        x[k-j+1]=10000;
        y[l-k]=10000;
        int m=0,n=0;
        for(int i=j; i<=l; i++)
        {
            if(x[m]<y[n])
            {
                a[i]=x[m];
                m++;
            }
            else
            {
                a[i]=y[n];
                n++;
            }
        }
    }
    }
}

/**
 * DA-IICT
 * Author : PARTH PATEL
 */
import java.io.*;
import java.math.*;
import java.util.*;

import static java.util.Arrays.fill;
import static java.lang.Math.*;
import static java.util.Arrays.sort;
import static java.util.Collections.sort;

public class MahmoudandEhabandtheMEX
{

	public static int mod = 1000000007;
	static FasterScanner in = new FasterScanner();
	static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args)
	{

		int n=in.nextInt();
		int x=in.nextInt();
		int[] arr=in.nextIntArray(n);
		Arrays.sort(arr);
		int answer=0;
		int temp=1;
		for(int i=0;i<n;i++)
		{
			while(i<n && temp<arr[i] && temp<x)
			{
				temp++;
				answer++;
			}
			if(arr[i]==x)
			{
				answer++;
				break;
			}
		}
		out.println(answer);

		out.close();

	}

	public static long pow(long x, long n, long mod)
	{
		long res = 1;
		for (long p = x; n > 0; n >>= 1, p = (p * p) % mod)
		{
			if ((n & 1) != 0)
			{
				res = (res * p % mod);
			}
		}
		return res;
	}

	public static long gcd(long n1, long n2)
	{
		long r;
		while (n2 != 0)
		{
			r = n1 % n2;
			n1 = n2;
			n2 = r;
		}
		return n1;
	}

	static class FasterScanner
	{
		private byte[] buf = new byte[1024];
		private int curChar;
		private int snumChars;

		public int read()
		{
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try
				{
					snumChars = System.in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public String nextString()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public long nextLong()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int nextInt()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n)
		{
			int[] arr = new int[n];
			for (int i = 0; i < n; i++)
			{
				arr[i] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray(int n)
		{
			long[] arr = new long[n];
			for (int i = 0; i < n; i++)
			{
				arr[i] = nextLong();
			}
			return arr;
		}

		private boolean isSpaceChar(int c)
		{
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c)
		{
			return c == '\n' || c == '\r' || c == -1;
		}
	}

}

/*
ID: acegikm1
LANG: JAVA
TASK: mex
*/
import java.util.*;
import java.io.*;
public class mex {
	public static void main(String[] args) throws Exception {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		// BufferedReader in = new BufferedReader(new FileReader("test.in"));
		PrintStream out = new PrintStream(new File("test.out"));
		// PrintStream out = new PrintStream(System.out);
		String line = in.readLine().trim(), lines[] = line.split(" ");

		int n = Integer.parseInt(lines[0]), x = Integer.parseInt(lines[1]);
		// int[] arr = new int[n];
		TreeSet<Integer> set = new TreeSet<Integer>();
		lines = in.readLine().trim().split(" ");
		for (int i = 0; i < n; i++) set.add(Integer.parseInt(lines[i]));

		int ans = 0;
		for (int i = 0; i < x; i++) {
			if (!set.contains(i)) ans++;
		}
		if (set.contains(x)) ans++;
		out.println(ans);
	}
}

//package CodeForces;

/*In the name of Allah the Most Merciful.
 * Author
 * Md. Toufiqul Islam
 * Dept. Of CSE
 * Ahsanullah University Of Science And Technology
*/
import java.util.*;
import java.io.*;
public class R435A {

          //Code for Faster Input
    	  public static class MyScanner {

    	      BufferedReader br;
    	      StringTokenizer st;

    	      public MyScanner() {
    	         br = new BufferedReader(new InputStreamReader(System.in));
    	      }

    	      String next() {
    	          while (st == null || !st.hasMoreElements()) {
    	              try {
    	                  st = new StringTokenizer(br.readLine());
    	              } catch (IOException e) {
    	                  e.printStackTrace();
    	              }
    	          }
    	          return st.nextToken();
    	      }

    	      int nextInt() {
    	          return Integer.parseInt(next());
    	      }

    	      long nextLong() {
    	          return Long.parseLong(next());
    	      }

    	      double nextDouble() {
    	          return Double.parseDouble(next());
    	      }

    	      String nextLine(){
    	          String str = "";
    		  try {
    		     str = br.readLine();
    		  } catch (IOException e) {
    		     e.printStackTrace();
    		  }
    		  return str;
    	      }

    	   }
    	   //--------------------------------------------------------

    static int getMex(List<Integer> list) {

    	      for(int i=0;i<list.size();i++){
    	          if(!list.contains(new Integer(i))){
    	              return i;
                  }
              }
              return -1;
    }
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        int n = sc.nextInt();
        int x = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.nextInt());

        }

        int count = 0;

        //System.out.println(getMex(list));
        while (true){
            int m = getMex(list);
            if(m==x){
                System.out.println(count);
                break;
            }
            else {
                if(m>=0) {
                    list.add(m);
                    count++;
                }
                else {
                    System.out.println(1);
                    break;
                }
            }
        }

     //   System.out.println(count);
    }

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author o_panda_o(emailofpanda@yahoo.com)
 */
public class Code_862A_MahmoudAndEhabAndTheMEX{
    public static void main(String[] args){
        InputStream inputStream=System.in;
        OutputStream outputStream=System.out;
        InputReader in=new InputReader(inputStream);
        OutputWriter out=new OutputWriter(outputStream);
        _862A_ solver=new _862A_();
        solver.solve(1,in,out);
        out.close();
    }

    static class _862A_{
        public void solve(int testNumber,InputReader in,OutputWriter out){
            int n=in.nextInt(), x=in.nextInt(), elements[]=in.nextSortedIntArray(n), pivot=-1;
            if(Arrays.binarySearch(elements,x)>=0) out.print(elements[n-1]+1-n+1);
            else out.print(Math.max(elements[n-1],x-1)-n);
        }

    }

    static class OutputWriter{
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream){
            writer=new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer){
            this.writer=new PrintWriter(writer);
        }

        public void close(){
            writer.close();
        }

        public void print(int i){
            writer.print(i);
        }

    }

    static class InputReader{
        private InputStream stream;
        private byte[] buf=new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream){
            this.stream=stream;
        }

        public int read(){
            if(numChars==-1){
                throw new InputMismatchException();
            }
            if(curChar>=numChars){
                curChar=0;
                try{
                    numChars=stream.read(buf);
                }catch(IOException e){
                    throw new InputMismatchException();
                }
                if(numChars<=0){
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt(){
            int c=read();
            while(isSpaceChar(c)){
                c=read();
            }
            int sgn=1;
            if(c=='-'){
                sgn=-1;
                c=read();
            }
            int res=0;
            do{
                if(c<'0'||c>'9'){
                    throw new InputMismatchException();
                }
                res*=10;
                res+=c-'0';
                c=read();
            }while(!isSpaceChar(c));
            return res*sgn;
        }

        public boolean isSpaceChar(int c){
            if(filter!=null){
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c){
            return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1;
        }

        public int[] nextIntArray(int n){
            int[] array=new int[n];
            for(int i=0;i<n;++i) array[i]=nextInt();
            return array;
        }

        public int[] nextSortedIntArray(int n){
            int array[]=nextIntArray(n);
            Arrays.sort(array);
            return array;
        }

        public interface SpaceCharFilter{
            public boolean isSpaceChar(int ch);

        }

    }
}

import java.util.*;

import javax.lang.model.util.ElementScanner6;
public class Test{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		// int t=sc.nextInt();
		// while(t-->0) {

		// }
		long n=sc.nextLong();
		long x=sc.nextLong();
		ArrayList<Integer> l=new ArrayList<>();
		for(int i=0;i<n;i++)
		{
			l.add(sc.nextInt());
		}
		Collections.sort(l);
		if(n==1)
		{
			if(l.indexOf(l.get(0))==x)
				System.out.println(1);
			else
				System.out.println(0);
		}
		else
		{
			int count=0;
		for(int i=0;i<x;i++)
		{
			if(l.indexOf(i)==-1)
				count++;
		}
		if(l.indexOf(x)!=-1)
			System.out.println(count+1);
		else
			System.out.println(count);
		}
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class C862A {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Test solver = new Test();
		solver.solve(1, in, out);
		out.close();
	}

	static class Test {

		public void solve(int i, InputReader in, PrintWriter out) {
			int n = in.nextInt();
			int k = in.nextInt();
			int[] num = new int[n];
			for (int j = 0; j < n; j++) {
				num[j] = in.nextInt();
			}
			Arrays.sort(num);
			if (num[0] > k) {
				out.println(k);
			} else {

					int count = 0;
					for (int j = 0; j < n; j++) {
						if (k >= num[j]) {
							count++;
						}
					}
					out.println(Math.abs(k - count));
			}
		}
	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

	}
}

import java.util.*;
import java.util.Map.Entry;
import java.util.regex.Pattern;
import java.io.*;
import java.math.BigInteger;

public class MainClass {

	 public static void main(String[] args) {
		 FastReader in = new FastReader();

		 int n = in.nextInt();
		 int x = in.nextInt();

		 ArrayList<Integer> a = new ArrayList();

		 for (int i=0; i<n; i++){
			 a.add(in.nextInt());
		 }

		 int Max = findMax(a);

		 if(x>n){
			 Max = x-Max-n;
		 }
		 else{
			 if(x-Max<0)
				 Max=Max-x;
			 else
				 Max = x-Max;
		 }

		 System.out.println(Max);

	 }

	private static int findMax(ArrayList<Integer> a) {
		int MEX=0;
		boolean flag=false;
		for (int i=0; i<a.size(); i++){

			 if(a.get(i)!=i){
				 flag=true;
				 MEX=i;break;
			 }
		 }
		if(!flag) MEX=a.get(a.size()-1)+1;

		return MEX;
	}

}

class FastReader
{
    BufferedReader br;
    StringTokenizer st;

    public FastReader()
    {
        br = new BufferedReader(new
                 InputStreamReader(System.in));
    }

    String next()
    {
        while (st == null || !st.hasMoreElements())
        {
            try
            {
                st = new StringTokenizer(br.readLine());
            }
            catch (IOException  e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt()
    {
        return Integer.parseInt(next());
    }

    long nextLong()
    {
        return Long.parseLong(next());
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String nextLine()
    {
        String str = "";
        try
        {
            str = br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }
}