    Var t,N,K,i,j:longint;
   h, a,b:array[1..100000000] of longint;
 Begin
   read(n,k);
   t:=0;
   for i :=1 to n do
   a[i]:=i div 2;
   if n mod 2 =0 then
   begin
   a[n+1]:=a[n];
   a[n+2]:=a[n];
   for i :=n+3 to 2*n do
   a[i]:=a[n]-(i-n-1)div 2;
   end;
   for i :=1 to k do
   read(b[i]);
   for j:=1 to k do
   begin
   i:=b[j]+1;
   while n+b[j]>=i do
  begin
  if h[i]=0 then
  begin
  a[i]:=a[i]-1 ;

  i:=i+1;
  end;
  end;
  for i :=1 to 2*n do
  if a[i]>0 then
  t:=t+1;
  write(t);



   {
   if n mod 2 =1 then
   begin
   a[n+1]:=a[n];
   a[n+2]:=a[n];
   for i :=n+3 to 2*n do
   a[i]:=a[n]-(i-n+1)div 2;
   end;
   for i :=1 to k do
   read(b[i]);
   for j:=1 to k do
   begin
   i:=b[j]+1;
   while n+b[j]>=i do
  begin if a[i]>0 then a[i]:=a[i]-1 ;
  i:=i+1;
  end;
  end;
  for i :=1 to 2*n do
  if a[i]>0 then
  t:=t+1;
  write(t);     }
  end;
  end.
