#include using namespace std; using ll = long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) int main(){ ll n,m; cin>>n>>m; vector a(m); rep(i,m) cin>>a.at(i); ll ans=0; if(a.back()==n-1) ans++; if(a.back()<=n-1){ a.push_back(n); m++; } if(a.at(0)==2) ans++; if(a.at(0)>=2){ a.push_back(1); m++; } sort(a.begin(),a.end()); rep(i,m-1){ ll df=a.at(i+1)-a.at(i)-1; if(df==0) continue; if(df!=1){ if(df&1) df--; } ans+=df; } cout<