const
  maxn = 1000000;
  maxk = 1000000;

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

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