N,M=map(int,input().split())
L=[]
for i in range(M):
  L.append(int(input()))
if L[0]-1==0:
  pass
else:
  q=(L[0]-1)//2+1
i=0
while i<M-1:
  if L[i]+1==L[i+1]:
    print(0)
    exit()
  else:
    q+=(L[i+1]-L[i]-1)//2+1
    i+=1
if L[M-1]==N-2:
  print(0)
  exit()
else:
  q+=(N-L[M-1]-1)//2+1
  print(q)

      
