const
  maxn = 1000000;
  maxk = 1000000;

var
  i, j, k, n, cnt : integer;
  a : array[1..maxk] of integer;
  good : array[1..maxn] of boolean;

procedure qsort(l, r : integer);
var
  i, j, x, t : integer;
begin
  if (l >= r) then exit;
  i := l;
  j := r;
  x := a[random(r - l + 1) + l];
  while (i <= j) do begin
    while (a[i] < x) do i := i + 1;
    while (a[j] > x) do j := j - 1;
    if (i <= j) then begin
      t := a[i]; a[i] := a[j]; a[j] := t;
      i := i + 1;
      j := j - 1;
    end;
  end;
  qsort(i, r);
  qsort(l, j);
end;

begin
  reset(input, 'elections.in');
  rewrite(output, 'elections.out');
  read(n, k);
  for i := 1 to k do begin
    read(a[i]);
  end;
  for i := 1 to n do begin
    good[i] := true;
  end;
  qsort(1, k);
  for i := 1 to k do begin
    if (good[a[i]]) then begin
      j := a[i];
      while (j <= n) do begin
        good[j] := false;
        j := j + a[i];
      end;
    end;
  end;
  cnt := 0;
  for i := 1 to n do begin
    if (good[i]) then begin
      cnt := cnt + 1;
    end;
  end;
  writeln(cnt);
end.