type Tmas = array [1..10000] of byte;
function inside(S,sum:ansistring):boolean;
var i:longint;
begin
  inside := true;
  i := pos(sum,S);
  if (i = 0) then inside := false;
end;
var N,K,i,a,j,dots,lc:longint; m:Tmas;S,sum:ansistring;
begin
  read(N,K);
  dots := 0;
  lc := 0;
  S := '';
  for i:= 1 to N do
    m[i] := 1;
  for i:= 1 to K do
  begin
    read(a);
    m[a] := 0;
  end;
  for i := 1 to N do
  begin
    for j:= 1 to N do
    begin
      if (m[i] <> 0) and (m[j] <> 0) then str(i+j,sum);
      if not(inside(S,sum)) then
      begin
        S := S + sum;
        lc := lc + length(sum) - 1;
        S := S + '.';
        inc(dots);
      end;
    end;
  end;
  writeln(length(S)-dots-lc);
end.
