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

public class standing_aa implements Runnable {

	public static void main(String[] args) {
		new Thread(new standing_aa()).start();
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	boolean eof = false;
	Random rand = new Random(this.hashCode());

	@Override
	public void run() {
		long time = System.currentTimeMillis();
		Locale.setDefault(Locale.US);
		try {
			br = new BufferedReader(new FileReader(FNAME + ".in"));
			out = new PrintWriter(FNAME + ".out");
			solve();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(566);
		}
		System.out.println((System.currentTimeMillis() - time) / 1000.0);
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return "0";
			}
		}
		return st.nextToken();
	}

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

	void myAssert(boolean u, String message) {
		if (!u) {
			throw new Error("Assertion failed!!! " + message);
		}
	}

	int inBounds(int x, int l, int r, String name) {
		myAssert(l <= x && x <= r, name + " not in bounds!!! " + x
				+ " not in [" + l + ".." + r + "]");
		return x;
	}

	String FNAME = "standing";

	private void solve() throws IOException {
		int n = inBounds(nextInt(), 1, 100, "n");
		int m = inBounds(nextInt(), 1, 1000000000, "m");
		int[] a = new int[n];
		for (int i = 0; i < a.length; i++) {
			a[i] = nextInt();
			myAssert(a[i] == 0 || m % a[i] == 0, "a[" + (i + 1)
					+ "] is not a divisor of " + m);
		}
		TreeSet<Integer> div = new TreeSet<Integer>();
		for (int i = 1; i * i <= m; i++) {
			if (m % i == 0) {
				div.add(i);
				div.add(m / i);
			}
		}
		int ans = 0;
		for (int i = 0; i < a.length; i++) {
			while (div.contains(a[i] + 1)) {
				a[i]++;
				ans++;
			}
		}
		out.println(ans);
	}
}
