const
  MAXN = 100;
  MAX = 1000000000;

var
  last, i, n, m, k, ans, a : integer;

begin
  reset(input, 'standing.in');
  rewrite(output, 'standing.out');
  read(n, m);
  assert((1 <= n) and (n <= MAXN));
  k := 1;
  while (m mod (k + 1) = 0) do begin
    k := k + 1;
  end;
  last := MAX;
  ans := 0;
  for i := 1 to n do begin
    read(a);
    assert((a = 0) or (m mod a = 0));
    assert(a <= last);
    if (a < k) then begin
      ans := ans + k - a;
    end;
    last := a;
  end;
  writeln(ans);
end.