Var m,d,i,y,h,j,z:longint;
N,K:int64;
q:boolean;
A:array[1..200000] of int64;
B:array[1..200000] of int64;
C:array[1..200000] of int64;
Begin
y:=1;
d:=1;
h:=1;
j:=1;
z:=0;
 read(N);
 for i:=1 to N do
  A[i]:=i;

 readln(K);
 for y:=1 to K do begin
 read(m);
  for i:=1 to N do
   if A[i]=m then A[i]:=0;
   end;


 for i:=1 to N do
  if A[i]>0 then begin B[y]:=A[i]; y:=y+1 end;
 for i:=1 to y-1 do begin
  C[d]:=B[i]*2;
  d:=d+1;
  for j:=i+1 to y-1 do begin
   if B[i]>0 then begin
   C[d]:=B[i]+B[j];
   d:=d+1;
   end;
   end;
   end;

  While h<d-1 do begin
   for j:= h+1 to d-1 do
    if C[j]=C[h] then C[j]:=0;
   h:=h+1
   end;

 for j:=1 to d-1 do
    if C[j]>1 then z:=z+1;
writeln(z);

End.

