/*
 * test.cpp
 *
 *  Created on: Sep 26, 2016
 *      Author: SCE15-0683
 */

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<map>
#include<cmath>
#include<bitset>
#include<set>
#include<iomanip>
#include<fstream>
#include<bitset>
#include<cstring>
#include<cstdlib>
#include<complex>
#include<list>
#include<sstream>

using namespace std;

typedef pair<int,int> ii;
typedef pair<int,long long> il;
typedef pair<long long,long long> ll;
typedef pair<ll,int> lli;
typedef pair<long long,int> li;
typedef pair<int,ii> iii;
typedef pair<int,il> iil;
typedef pair<li,ii> liii;
long long mod = 1000000007LL;
long long base = 37;
long long large = 1000000000000000000LL;

int main(){
	int m;
	string s;
	cin>>m>>s;
	int n=(int)s.length();
	vector<int> a(n,0);
	for(int i=0;i<n;i++){
		a[i]=(int)(s[i]-'a');
	}
	int l = n-m+1;
	vector<bool> u(l,false);
	int c = 0;
	int cnt = 0;
	for(;c<26;c++){
		cnt=0;
		vector<int> re(0,0);
		for(int i=0;i<l;i++){
			if(!u[i]) re.push_back(i);
		}
		if(re.size()==0) break;
		bool can = true;
		vector<int> seg(0,0);
		for(int i=0;i<n;i++){
			if(a[i]==c) seg.push_back(i-m+1);
		}
		if(seg.size()==0) continue;
		int rb= -m-10;
		int p=0;
		for(int i=0;i<(int)re.size();i++){
			if(re[i]<=rb) continue;
			while(p+1<(int)seg.size()&&seg[p+1]<=re[i]) p++;

			rb=seg[p]+m-1;
			if(rb<re[i]||re[i]<seg[p]){
				can=false;
				break;
			}else{
				cnt++;
			}
		}
		if(can){
			break;
		}else{
			vector<int> t;
			for(int i=0;i<n;i++){
				if(a[i]==c) t.push_back(i-m+1);
			}
			rb = -m-10;
			p = 0;
			for(int i=0;i<l;i++){
				if(i<=rb) u[i]=true;
				while(p+1<(int)t.size()&&t[p+1]<=i) p++;
				rb=t[p]+m-1;
				if(i<=rb&&i>=t[p]) u[i]=true;
			}
		}
	}
	vector<int> cn(30,0);
	for(int i=0;i<n;i++) cn[a[i]]++;
	for(int i=0;i<c;i++) {
		while(cn[i]--) cout<<(char)('a'+i);
	}
	while(cnt--) cout<<(char)('a'+c);
	cout<<endl;
	//cerr<<"!"<<endl;
	return 0;

}


/*
 * test.cpp
 *
 *  Created on: Sep 26, 2016
 *      Author: SCE15-0683
 */

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<map>
#include<cmath>
#include<bitset>
#include<set>
#include<iomanip>
#include<fstream>
#include<bitset>
#include<cstring>
#include<cstdlib>
#include<complex>
#include<list>
#include<sstream>

using namespace std;

typedef pair<int,int> ii;
typedef pair<int,long long> il;
typedef pair<long long,long long> ll;
typedef pair<ll,int> lli;
typedef pair<long long,int> li;
typedef pair<int,ii> iii;
typedef pair<int,il> iil;
typedef pair<li,ii> liii;
long long mod = 1000000007LL;
long long base = 37;
long long large = 1000000000000000000LL;

int main(){
	int m;
	string s;
	cin>>m>>s;
	int n=(int)s.length();
	vector<int> a(n,0);
	for(int i=0;i<n;i++){
		a[i]=(int)(s[i]-'a');
	}
	int l = n-m+1;
	vector<bool> u(l,false);
	int c=0;
	int cnt = 0;
	for(;c<26;c++){
		cnt=0;
		vector<int> re;
		for(int i=0;i<l;i++){
			if(!u[i]) re.push_back(i);
		}
		bool can = true;
		vector<int> seg;
		for(int i=0;i<n;i++){
			if(a[i]==c) seg.push_back(i-m+1);
		}
		if(seg.size()==0) continue;
		int rb= -1000000000;
		int p=-1;
		for(int i=0;i<(int)re.size();i++){
			if(re[i]<=rb) continue;
			while(p+1<(int)seg.size()&&seg[p+1]<=re[i]) p++;
			rb=seg[p]+m-1;
			if(rb<re[i]){
				can=false;
				break;
			}else{
				cnt++;
			}
		}
		if(can){
			break;
		}else{
			seg.clear();
			for(int i=0;i<n;i++){
				if(a[i]==c) seg.push_back(i-m+1);
			}
			int rb = -1000000000;
			int p = -1;
			for(int i=0;i<l;i++){
				if(i<=rb) u[i]=true;
				while(p+1<(int)seg.size()&&seg[p+1]<=i)p++;
				rb=seg[p]+m-1;
				if(i<=rb) u[i]=true;
			}
		}
	}
	vector<int> cn(30,0);
	for(int i=0;i<n;i++) cn[a[i]]++;
	for(int i=0;i<c;i++) {
		while(cn[i]--) cout<<(char)('a'+i);
	}
	while(cnt--) cout<<(char)('a'+c);
	cout<<endl;
	return 0;

}


/*
 * test.cpp
 *
 *  Created on: Sep 26, 2016
 *      Author: SCE15-0683
 */

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<map>
#include<cmath>
#include<bitset>
#include<set>
#include<iomanip>
#include<fstream>
#include<bitset>
#include<cstring>
#include<cstdlib>
#include<complex>
#include<list>
#include<sstream>

using namespace std;

typedef pair<int,int> ii;
typedef pair<int,long long> il;
typedef pair<long long,long long> ll;
typedef pair<ll,int> lli;
typedef pair<long long,int> li;
typedef pair<int,ii> iii;
typedef pair<int,il> iil;
typedef pair<li,ii> liii;
long long mod = 1000000007LL;
long long base = 37;
long long large = 1000000000000000000LL;

int main(){
	int m;
	string s;
	cin>>m>>s;
	int n=(int)s.length();
	vector<int> a(n,0);
	for(int i=0;i<n;i++){
		a[i]=(int)(s[i]-'a');
	}
	int l = n-m+1;
	vector<bool> u(l,false);
	int c = 0;
	int cnt = 0;
	for(;c<26;c++){
		cnt=0;
		vector<int> re(0,0);
		for(int i=0;i<l;i++){
			if(!u[i]) re.push_back(i);
		}
		if(re.size()==0) break;
		bool can = true;
		vector<int> seg(0,0);
		for(int i=0;i<n;i++){
			if(a[i]==c) seg.push_back(i-m+1);
		}
		if(seg.size()==0) continue;
		int rb= -m-10;
		int p=-1;
		for(int i=0;i<(int)re.size();i++){
			if(re[i]<=rb) continue;
			while(p+1<(int)seg.size()&&seg[p+1]<=re[i]) p++;
			if(p==-1){
				can=false;
				break;
			}
			rb=seg[p]+m-1;
			if(rb<re[i]){
				can=false;
				break;
			}else{
				cnt++;
			}
		}
		if(can){
			break;
		}else{
			vector<int> t;
			for(int i=0;i<n;i++){
				if(a[i]==c) t.push_back(i-m+1);
			}
			rb = -m-10;
			p = -1;
			for(int i=0;i<l;i++){
				if(i<=rb) u[i]=true;
				while(p+1<(int)t.size()&&t[p+1]<=i) p++;
				rb=t[p]+m-1;
				if(i<=rb) u[i]=true;
			}
		}
	}
	vector<int> cn(30,0);
	for(int i=0;i<n;i++) cn[a[i]]++;
	for(int i=0;i<c;i++) {
		while(cn[i]--) cout<<(char)('a'+i);
	}
	while(cnt--) cout<<(char)('a'+c);
	cout<<endl;
	//cerr<<"!"<<endl;
	return 0;

}


/*
 * test.cpp
 *
 *  Created on: Sep 26, 2016
 *      Author: SCE15-0683
 */

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<map>
#include<cmath>
#include<bitset>
#include<set>
#include<iomanip>
#include<fstream>
#include<bitset>
#include<cstring>
#include<cstdlib>
#include<complex>
#include<list>
#include<sstream>

using namespace std;

typedef pair<int,int> ii;
typedef pair<int,long long> il;
typedef pair<long long,long long> ll;
typedef pair<ll,int> lli;
typedef pair<long long,int> li;
typedef pair<int,ii> iii;
typedef pair<int,il> iil;
typedef pair<li,ii> liii;
long long mod = 1000000007LL;
long long base = 37;
long long large = 1000000000000000000LL;

int main(){
	int m;
	string s;
	cin>>m>>s;
	int n=(int)s.length();
	vector<int> a(n,0);
	for(int i=0;i<n;i++){
		a[i]=(int)(s[i]-'a');
	}
	int l = n-m+1;
	vector<bool> u(l,false);
	int c;
	int cnt = 0;
	for(c=0;c<26;c++){
		cnt=0;
		vector<int> re;
		for(int i=0;i<l;i++){
			if(!u[i]) re.push_back(i);
		}
		bool can = true;
		vector<int> seg;
		for(int i=0;i<n;i++){
			if(a[i]==c) seg.push_back(i-m+1);
		}
		if(seg.size()==0) continue;
		int rb= -1000000000;
		int p=-1;
		for(int i=0;i<(int)re.size();i++){
			if(re[i]<=rb) continue;
			while(p+1<(int)seg.size()&&seg[p+1]<=re[i]) p++;
			rb=seg[p]+m-1;
			if(rb<re[i]){
				can=false;
				break;
			}else{
				cnt++;
			}
		}
		if(can){
			break;
		}else{
			seg.clear();
			for(int i=0;i<n;i++){
				if(a[i]==c) seg.push_back(i-m+1);
			}
			int rb = -1000000000;
			int p = -1;
			for(int i=0;i<l;i++){
				if(i<=rb) u[i]=true;
				while(p+1<(int)seg.size()&&seg[p+1]<=i)p++;
				rb=seg[p]+m-1;
				if(i<=rb) u[i]=true;
			}
		}
	}
	vector<int> cn(30,0);
	for(int i=0;i<n;i++) cn[a[i]]++;
	for(int i=0;i<c;i++) while(cn[i]--) cout<<(char)(i+'a');
	while(cnt--) cout<<(char)('a'+c);
	cout<<endl;
	return 0;

}


/*
 * test.cpp
 *
 *  Created on: Sep 26, 2016
 *      Author: SCE15-0683
 */

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<map>
#include<cmath>
#include<bitset>
#include<set>
#include<iomanip>
#include<fstream>
#include<bitset>
#include<cstring>
#include<cstdlib>
#include<complex>
#include<list>
#include<sstream>

using namespace std;

typedef pair<int,int> ii;
typedef pair<int,long long> il;
typedef pair<long long,long long> ll;
typedef pair<ll,int> lli;
typedef pair<long long,int> li;
typedef pair<int,ii> iii;
typedef pair<int,il> iil;
typedef pair<li,ii> liii;
long long mod = 1000000007LL;
long long base = 37;
long long large = 1000000000000000000LL;

int main(){
	int m;
	string s;
	cin>>m>>s;
	int n=(int)s.length();
	vector<int> a(n,0);
	for(int i=0;i<n;i++){
		a[i]=(int)(s[i]-'a');
	}
	int l = n-m+1;
	vector<bool> u(l,false);
	int c=0;
	int cnt = 0;
	for(;c<26;c++){
		cnt=0;
		vector<int> re(0,0);
		for(int i=0;i<l;i++){
			if(!u[i]) re.push_back(i);
		}
		if(re.size()==0) break;
		bool can = true;
		vector<int> seg(0,0);
		for(int i=0;i<n;i++){
			if(a[i]==c) seg.push_back(i-m+1);
		}
		if(seg.size()==0) continue;
		int rb= -m-10;
		int p=-1;
		for(int i=0;i<(int)re.size();i++){
			if(re[i]<=rb) continue;
			while(p+1<(int)seg.size()&&seg[p+1]<=re[i]) p++;
			rb=seg[p]+m-1;
			if(rb<re[i]){
				can=false;
				break;
			}else{
				cnt++;
			}
		}
		if(can){
			break;
		}else{
			vector<int> t;
			for(int i=0;i<n;i++){
				if(a[i]==c) t.push_back(i-m+1);
			}
			int rb = -m-10;
			int p = -1;
			for(int i=0;i<l;i++){
				if(i<=rb) u[i]=true;
				while(p+1<(int)t.size()&&t[p+1]<=i) p++;
				rb=t[p]+m-1;
				if(i<=rb) u[i]=true;
			}
		}
	}
	vector<int> cn(30,0);
	for(int i=0;i<n;i++) cn[a[i]]++;
	for(int i=0;i<c;i++) {
		while(cn[i]--) cout<<(char)('a'+i);
	}
	while(cnt--) cout<<(char)('a'+c);
	cout<<endl;
	return 0;

}


/*
 * test.cpp
 *
 *  Created on: Sep 26, 2016
 *      Author: SCE15-0683
 */

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<map>
#include<cmath>
#include<bitset>
#include<set>
#include<iomanip>
#include<fstream>
#include<bitset>
#include<cstring>
#include<cstdlib>
#include<complex>
#include<list>
#include<sstream>

using namespace std;

typedef pair<int,int> ii;
typedef pair<int,long long> il;
typedef pair<long long,long long> ll;
typedef pair<ll,int> lli;
typedef pair<long long,int> li;
typedef pair<int,ii> iii;
typedef pair<int,il> iil;
typedef pair<li,ii> liii;
long long mod = 1000000007LL;
long long base = 37;
long long large = 1000000000000000000LL;

int main(){
	int m;
	string s;
	cin>>m>>s;
	int n=(int)s.length();
	vector<int> a(n,0);
	for(int i=0;i<n;i++){
		a[i]=(int)(s[i]-'a');
	}
	int l = n-m+1;
	vector<bool> u(l,false);
	int c = 0;
	int cnt = 0;
	for(;c<26;c++){
		cnt=0;
		vector<int> re(0,0);
		for(int i=0;i<l;i++){
			if(!u[i]) re.push_back(i);
		}
		if(re.size()==0) break;
		bool can = true;
		vector<int> seg(0,0);
		for(int i=0;i<n;i++){
			if(a[i]==c) seg.push_back(i-m+1);
		}
		if(seg.size()==0) continue;
		int rb= -m-10;
		int p=-1;
		for(int i=0;i<(int)re.size();i++){
			if(re[i]<=rb) continue;
			while(p+1<(int)seg.size()&&seg[p+1]<=re[i]) p++;
			if(p==-1){
				can=false;
				break;
			}
			rb=seg[p]+m-1;
			if(rb<re[i]){
				can=false;
				break;
			}else{
				cnt++;
			}
		}
		if(can){
			break;
		}else{
			vector<int> t;
			for(int i=0;i<n;i++){
				if(a[i]==c) t.push_back(i-m+1);
			}
			rb = -m-10;
			p = -1;
			for(int i=0;i<l;i++){
				if(i<=rb) u[i]=true;
				while(p+1<(int)t.size()&&t[p+1]<=i) p++;
				if(p==-1) continue;
				rb=t[p]+m-1;
				if(i<=rb) u[i]=true;
			}
		}
	}
	vector<int> cn(30,0);
	for(int i=0;i<n;i++) cn[a[i]]++;
	for(int i=0;i<c;i++) {
		while(cn[i]--) cout<<(char)('a'+i);
	}
	while(cnt--) cout<<(char)('a'+c);
	cout<<endl;
	//cerr<<"!"<<endl;
	return 0;

}


/*
 * test.cpp
 *
 *  Created on: Sep 26, 2016
 *      Author: SCE15-0683
 */

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<map>
#include<cmath>
#include<bitset>
#include<set>
#include<iomanip>
#include<fstream>
#include<bitset>
#include<cstring>
#include<cstdlib>
#include<complex>
#include<list>
#include<sstream>

using namespace std;

typedef pair<int,int> ii;
typedef pair<int,long long> il;
typedef pair<long long,long long> ll;
typedef pair<ll,int> lli;
typedef pair<long long,int> li;
typedef pair<int,ii> iii;
typedef pair<int,il> iil;
typedef pair<li,ii> liii;
long long mod = 1000000007LL;
long long base = 37;
long long large = 1000000000000000000LL;

int main(){
	int m;
	string s;
	cin>>m>>s;
	int n=(int)s.length();
	vector<int> a(n,0);
	for(int i=0;i<n;i++){
		a[i]=(int)(s[i]-'a');
	}
	int l = n-m+1;
	vector<bool> u(l,false);
	int c = 0;
	int cnt = 0;
	for(;c<26;c++){
		cnt=0;
		vector<int> re(0,0);
		for(int i=0;i<l;i++){
			if(!u[i]) re.push_back(i);
		}
		if(re.size()==0) break;
		bool can = true;
		vector<int> seg(0,0);
		for(int i=0;i<n;i++){
			if(a[i]==c) seg.push_back(i-m+1);
		}
		if(seg.size()==0) continue;
		int rb= -m-10;
		int p=0;
		for(int i=0;i<(int)re.size();i++){
			if(re[i]<=rb) continue;
			while(p+1<(int)seg.size()&&seg[p+1]<=re[i]) p++;

			rb=seg[p]+m-1;
			if(re[i]<seg[p]||rb<re[i]){
				can=false;
				break;
			}else{
				cnt++;
			}
		}
		if(can){
			break;
		}else{
			vector<int> t;
			for(int i=0;i<n;i++){
				if(a[i]==c) t.push_back(i-m+1);
			}
			rb = -m-10;
			p = -1;
			for(int i=0;i<l;i++){
				if(i<=rb) u[i]=true;
				while(p+1<(int)t.size()&&t[p+1]<=i) p++;
				if(p==-1) continue;
				rb=t[p]+m-1;
				if(i<=rb) u[i]=true;
			}
		}
	}
	vector<int> cn(30,0);
	for(int i=0;i<n;i++) cn[a[i]]++;
	for(int i=0;i<c;i++) {
		while(cn[i]--) cout<<(char)('a'+i);
	}
	while(cnt--) cout<<(char)('a'+c);
	cout<<endl;
	//cerr<<"!"<<endl;
	return 0;

}


/*
 * test.cpp
 *
 *  Created on: Sep 26, 2016
 *      Author: SCE15-0683
 */

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<map>
#include<cmath>
#include<bitset>
#include<set>
#include<iomanip>
#include<fstream>
#include<bitset>
#include<cstring>
#include<cstdlib>
#include<complex>
#include<list>
#include<sstream>

using namespace std;

typedef pair<int,int> ii;
typedef pair<int,long long> il;
typedef pair<long long,long long> ll;
typedef pair<ll,int> lli;
typedef pair<long long,int> li;
typedef pair<int,ii> iii;
typedef pair<int,il> iil;
typedef pair<li,ii> liii;
long long mod = 1000000007LL;
long long base = 37;
long long large = 1000000000000000000LL;

int main(){
	int m;
	string s;
	cin>>m>>s;
	int n=(int)s.length();
	vector<int> a(n,0);
	for(int i=0;i<n;i++){
		a[i]=(int)(s[i]-'a');
	}
	int l = n-m+1;
	vector<bool> u(l,false);
	int c;
	int cnt = 0;
	for(c=0;c<26;c++){
		cnt=0;
		vector<int> re;
		for(int i=0;i<l;i++){
			if(!u[i]) re.push_back(i);
		}
		bool can = true;
		vector<int> seg;
		for(int i=0;i<n;i++){
			if(a[i]==c) seg.push_back(i-m+1);
		}
		int rb= -1000000000;
		int p=0;
		for(int i=0;i<(int)re.size();i++){
			if(re[i]<=rb) continue;
			while(p+1<(int)seg.size()&&seg[p+1]<=re[i]) p++;
			rb=seg[p]+m-1;
			if(rb<re[i]){
				can=false;
				break;
			}else{
				cnt++;
			}
		}
		if(can){
			break;
		}else{
			seg.clear();
			for(int i=0;i<n;i++){
				if(a[i]==c) seg.push_back(i-m+1);
			}
			int rb = -1000000000;
			int p = 0;
			for(int i=0;i<l;i++){
				if(i<=rb) u[i]=true;
				while(p+1<(int)seg.size()&&seg[p+1]<=i)p++;
				rb=seg[p]+m-1;
				if(i<=rb) u[i]=true;
			}
		}
	}
	vector<int> cn(30,0);
	for(int i=0;i<n;i++) cn[a[i]]++;
	for(int i=0;i<c;i++) while(cn[i]--) cout<<(char)(i+'a');
	while(cnt--) cout<<(char)('a'+c);
	cout<<endl;
	return 0;

}


#include <bits/stdc++.h>

#pragma GCC optimize("O3")
using namespace std;
#define ll long long
#define ull unsigned long long
#define rep(i,n,N) for(int i=n;i<=N;++i)
#define rap(i,n,N) for(int i=n;i>=N;--i)
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
//#define ff fi.fi
//#define fs fi.se
//#define sf se.fi
//#define ss se.se
#define lc (id<<1)
#define rc ((id<<1)|1)
#define db(x) cerr << ">>>>>> " << #x << " -> " << x << endl
#define nani(x) cerr <<  "Line " << __LINE__ << ": " << #x << " is " << x << endl
#define all(x) x.begin(),x.end()
#define pii pair<int,int>
#define pll pair<ll,ll>
#define plll pair<ll,pll>
#define piii pair<int,pii>
#define piiii pair<pii,pii>
#define psi pair<string,int>
#define endl '\n'
const int MAX = 2e5+5;
const ll MAX2 = 11;
const ll MOD = 1000204921;
const ll MOD2 = 1000005329;
const ll INF = 2e18;
const int dr[]={1,0,-1,0,1,1,-1,-1,0};
const int dc[]={0,1,0,-1,1,-1,1,-1,0};
const double pi = acos(-1);
const double EPS = 1e-9;
const int block = 2000;

int n,m,a,b,r[MAX],c[MAX],ans;

int main(){
//	cout<<fixed<<setprecision(10);
//    freopen("input.txt", "r", stdin);
//	freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin>>n>>m;
    memset(r,1,sizeof r), memset(c,1,sizeof c);
    while(m--){
    	cin>>a>>b;
    	r[a] = c[b] = 0;
	}
	a = 2, b = n-1;
	while(a<b){
		if((r[a]|c[b])&&(r[b]|c[a]))ans+=2;
		else if(r[a]|r[b]|c[a]|c[b])++ans;
		++a, --b;
	}
	if(a==b && (r[a]||c[b]))++ans;
	cout<<ans<<endl;
    return 0;
}


/**
 	Template created by Danel Batyrbek
 	All rights are reserved 2017 (lol)
*/

#include <bits/stdc++.h>

#define speed_up ios_base :: sync_with_stdio(0);cin.tie(0)
#define fr first
#define sc second
#define mkp make_pair
#define pb push_back
#define eb emplace_back
#define ins insert
#define all(x) x.begin(), x.end()
#define debug(x) cerr << x << '\n';
#define YES "YES"
#define NO "NO"
#define skip continue
#define left(x) x << 1
#define rght(x) x << 1 | 1
#define forn(x, y, z) for(int x = y; x <= z; ++ x)
#define for1(x, y, z) for(int x = y; x >= z; -- x)
#define fname ""
using namespace std;

typedef long long ll;
typedef pair <int, int> pii;
typedef double ld;

const int N = 1e5 + 10;
const int mod = 1e9 + 7;
const int N3 = 1e3 + 10;
const int INF = 2e9 + 10;
const ll LINF = 2e18;

int n, m, cnt;
bool ux[N], uy[N];

int main(){
#ifdef DEBUG
	freopen("in", "r", stdin);
#else
	if(fname != ""){
	freopen(fname".in", "r", stdin);
	freopen(fname".out", "w", stdout);
	}
#endif
	cin >> n >> m;
	forn(i, 1, m){
		int x, y;
		cin >> x >> y;
		ux[x] = 1;
		uy[y] = 1;
	}
	ux[1] = 1;
	uy[1] = 1;
	ux[n] = 1;
	uy[n] = 1;

	forn(i, 2, n / 2){
		if(ux[i] == 0){
			cnt ++;
			ux[i] = 1;
		}
		if(ux[n - i + 1] == 0){
			cnt ++;
			ux[n - i + 1] = 1;
		}
		if(uy[n - i + 1] == 0){
			cnt ++;
			uy[n - i + 1] = 1;
		}
		if(uy[n - i + 1] == 0){
			cnt ++;
			uy[n - i + 1] = 1;
		}
	}
	if(n % 2 == 1){
		if(ux[n / 2 + 1] == 0 || uy[n / 2 + 1] == 0){
			cnt ++;
		}
	}

	cout << cnt;
	return 0;
}


/**
 	Template created by Danel Batyrbek
 	All rights are reserved 2017 (lol)
*/

#include <bits/stdc++.h>

#define speed_up ios_base :: sync_with_stdio(0);cin.tie(0)
#define fr first
#define sc second
#define mkp make_pair
#define pb push_back
#define eb emplace_back
#define ins insert
#define all(x) x.begin(), x.end()
#define debug(x) cerr << x << '\n';
#define YES "YES"
#define NO "NO"
#define skip continue
#define left(x) x << 1
#define rght(x) x << 1 | 1
#define forn(x, y, z) for(int x = y; x <= z; ++ x)
#define for1(x, y, z) for(int x = y; x >= z; -- x)
#define fname ""
using namespace std;

typedef long long ll;
typedef pair <int, int> pii;
typedef double ld;

const int N = 1e5 + 10;
const int mod = 1e9 + 7;
const int N3 = 1e3 + 10;
const int INF = 2e9 + 10;
const ll LINF = 2e18;

int n, m, cnt;
bool ux[N], uy[N];

int main(){
#ifdef DEBUG
	freopen("in", "r", stdin);
#else
	if(fname != ""){
	freopen(fname".in", "r", stdin);
	freopen(fname".out", "w", stdout);
	}
#endif
	cin >> n >> m;
	forn(i, 1, m){
		int x, y;
		cin >> x >> y;
		ux[x] = 1;
		uy[y] = 1;
	}
	ux[1] = 1;
	uy[1] = 1;
	ux[n] = 1;
	uy[n] = 1;

	forn(i, 2, n / 2){
		if(ux[i] == 0){
			cnt ++;
			ux[i] = 1;
		}
		if(ux[n - i + 1] == 0){
			cnt ++;
			ux[n - i + 1] = 1;
		}
		if(uy[i] == 0){
			cnt ++;
			uy[n - i + 1] = 1;
		}
		if(uy[n - i + 1] == 0){
			cnt ++;
			uy[n - i + 1] = 1;
		}
	}
	if(n % 2 == 1){
		if(ux[n / 2 + 1] == 0 || uy[n / 2 + 1] == 0){
			cnt ++;
		}
	}

	cout << cnt;
	return 0;
}

/*
	.O...
	..X..
	O....
	O....
	...O.
*/


/**
 	Template created by Danel Batyrbek
 	All rights are reserved 2017 (lol)
*/

#include <bits/stdc++.h>

#define speed_up ios_base :: sync_with_stdio(0);cin.tie(0)
#define fr first
#define sc second
#define mkp make_pair
#define pb push_back
#define eb emplace_back
#define ins insert
#define all(x) x.begin(), x.end()
#define debug(x) cerr << x << '\n';
#define YES "YES"
#define NO "NO"
#define skip continue
#define left(x) x << 1
#define rght(x) x << 1 | 1
#define forn(x, y, z) for(int x = y; x <= z; ++ x)
#define for1(x, y, z) for(int x = y; x >= z; -- x)
#define fname ""
using namespace std;

typedef long long ll;
typedef pair <int, int> pii;
typedef double ld;

const int N = 1e5 + 10;
const int mod = 1e9 + 7;
const int N3 = 1e3 + 10;
const int INF = 2e9 + 10;
const ll LINF = 2e18;

int n, m, cnt;
bool ux[N], uy[N];

int main(){
#ifdef DEBUG
	freopen("in", "r", stdin);
#else
	if(fname != ""){
	freopen(fname".in", "r", stdin);
	freopen(fname".out", "w", stdout);
	}
#endif
	cin >> n >> m;
	forn(i, 1, m){
		int x, y;
		cin >> x >> y;
		ux[x] = 1;
		uy[y] = 1;
	}
	ux[1] = 1;
	uy[1] = 1;
	ux[n] = 1;
	uy[n] = 1;

	forn(i, 2, n / 2){
		if(ux[i] == 0){
			cnt ++;
			ux[i] = 1;
		}
		if(ux[n - i + 1] == 0){
			cnt ++;
			ux[n - i + 1] = 1;
		}
		if(uy[i] == 0){
			cnt ++;
			uy[i] = 1;
		}
		if(uy[n - i + 1] == 0){
			cnt ++;
			uy[n - i + 1] = 1;
		}
	}
	if(n % 2 == 1){
		if(ux[n / 2 + 1] == 0 || uy[n / 2 + 1] == 0){
			cnt ++;
		}
	}

	cout << cnt;
	return 0;
}

/*
	.O...
	..X..
	O....
	O....
	...O.
*/


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,m;
    cin>>n>>m;
    vector <long long> vect1(n+1),vect2(n+1);
    for(int i=0;i<m;i++)
    {
        long long a,b;
        cin>>a>>b;
        vect1[a]=1;vect2[b]=1;
    }
    long long ans=2*(n-2);
    for(int i=2;i<n;i++)
    {
        if(vect1[i]==1)
            ans--;
        if(vect2[i]==1)
            ans--;
    }
    if(n%2==1 && vect1[n/2+1]==0 && vect2[n/2+1]==0)
        ans--;
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,m;
    cin>>n>>m;
    long long a[n+1][m+1]={};
    for(int i=1;i<=m;i++)
    {
        long long a1,b;
        cin>>a1>>b;
        a[a1][b]=-1;
    }
    long long count1=0;
    for(int i=2;i<n;i++)
    {
        long long flag=1,flag2=0;
        for(int j=1;j<n;j++)
        {
            if(a[i][j]==-1 || flag==a[i][j])
            {
                flag2=1;
                break;
            }
            flag++;
        }
        if(flag2==0)
        {
            count1++;flag2=1;
            for(int j=1;j<n;j++)
            {
                a[i][j]=flag2;
                flag2++;
            }
        }
    }

    for(int i=2;i<n;i++)
    {
        long long flag=1,flag2=0;
        for(int j=1;j<n;j++)
        {
            if(a[j][i]==-1 || flag==a[j][i])
            {
                flag2=1;
                break;
            }
            flag++;
        }
        if(flag2==0)
        {
            count1++;flag2=1;
            for(int j=1;j<n;j++)
            {
                a[j][i]=flag2;
                flag2++;
            }
        }
    }
    cout<<count1<<endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = (int)(1e3 + 123);

bool u[2 * maxn];
int n, m;

int main(){
	cin >> n >> m;
	for(int i = 1; i <= m; ++i){
		int x, y;
		cin >> x >> y;
		u[x] = 1;
		u[y + n] = 1;
	}
	int cnt1, cnt2;
	cnt1 = cnt2 = 0;
	for(int i = 2; i < n; ++i){
		if(!u[i]) cnt1++;
		if(!u[i + n]) cnt2++;
	}
	u[1 + n] = 1, u[1] = 1, u[n + n] = 1, u[n] = 1;
	int ans = max(cnt2, cnt1);
	if(cnt2 > cnt1){
		for(int i = 2; i < n; ++i){
			if(u[i + n]) continue;
			if(u[i] || u[n - i]) ans++;
		}
	} else {
		for(int i = 2; i < n; ++i){
			if(u[i]) continue;
			if(u[i + n] || u[n - i + n]) ans++;
		}
	}
	cout << ans;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = (int)(1e3 + 123);

bool u[maxn];
int n, m;

int main(){
	cin >> n >> m;
	for(int i = 1; i <= m; ++i){
		int x, y;
		cin >> x >> y;
		u[x] = 1;
	}
	int ans = 0;
	for(int i = 2; i < n; ++i){
		if(!u[i]) ans++;
	}
	cout << ans;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = (int)(1e3 + 123);

bool u[2 * maxn];
int n, m;

int main(){
	cin >> n >> m;
	for(int i = 1; i <= m; ++i){
		int x, y;
		cin >> x >> y;
		u[x] = 1;
		u[y + n] = 1;
	}
	int cnt1, cnt2;
	cnt1 = cnt2 = 0;
	for(int i = 2; i < n; ++i){
		if(!u[i]) cnt1++;
		if(!u[i + n]) cnt2++;
	}
	int ans = max(cnt2, cnt1);
	if(cnt2 > cnt1){
		for(int i = 2; i < n; ++i){
			if(u[i + n]) continue;
			if(!u[i] || !u[n - i]) ans++;
		}
	} else {
		for(int i = 2; i < n; ++i){
			if(u[i]) continue;
			if(!u[i + n] || !u[n - i + n]) ans++;
		}
	}
	cout << ans;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = (int)(1e3 + 123);

bool u[2 * maxn];
int n, m, dir[maxn];

int main(){
	cin >> n >> m;
	for(int i = 1; i <= m; ++i){
		int x, y;
		cin >> x >> y;
		u[x] = 1;
		u[y + n] = 1;
	}
	int cnt1, cnt2;
	cnt1 = cnt2 = 0;
	for(int i = 2; i < n; ++i){
		if(!u[i]) cnt1++;
		if(!u[i + n]) cnt2++;
	}
	int ans = max(cnt2, cnt1);
	u[1] = u[n] = u[1 + n] = u[2 * n] = 1;
	if(cnt2 > cnt1){
		for(int i = 2; i < n; ++i){
			if(u[i]) continue;
			if(u[i + n]){
				ans++;
				u[i] = 1;
			}
		}
		for(int i = 2; i < n; ++i){
			if(u[i]) continue;
			if(u[n - i + 1 + n] || (n - i + 1 != i)) ans++;
		}
	} else {
		for(int i = 2; i < n; ++i){
			if(u[i + n]) continue;
			if(u[i]){
				ans++;
				u[i + n] = 1;
			}
		}
		for(int i = 2; i < n; ++i){
			if(u[i + n]) continue;
			if(u[n - i + 1] || (n - i + 1 != i)) ans++;
		}
	}
	cout << ans;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = (int)(1e3 + 123);

bool u[2 * maxn];
int n, m;

int main(){
	cin >> n >> m;
	for(int i = 1; i <= m; ++i){
		int x, y;
		cin >> x >> y;
		u[x] = 1;
		u[y + n] = 1;
	}
	int cnt1, cnt2;
	cnt1 = cnt2 = 0;
	for(int i = 2; i < n; ++i){
		if(!u[i]) cnt1++;
		if(!u[i + n]) cnt2++;
	}
	int ans = max(cnt2, cnt1);
	if(cnt2 > cnt1){
		for(int i = 2; i < n; ++i){
			if(u[i + n]) continue;
			if(u[i] || u[n - i]) ans++;
		}
	} else {
		for(int i = 2; i < n; ++i){
			if(u[i]) continue;
			if(u[i + n] || u[n - i + n]) ans++;
		}
	}
	cout << ans;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<string> vs;

#define FOR(i, a, n) for (int i = (a); a<n? i<n:i>n; a<n? i++:i--)
#define trav(a, x) for (auto& a : x)
#define all(x) x.begin(), x.end()
#define sortall(x) sort(all(x))
#define clr(x) memset(x, 0, sizeof(x))
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define deb(x) cout << #x << "=" << x << endl
#define lli ll
#define bhag_milkha ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const int MOD = 1000000007;
const int N = 2e5;

ll mpow(ll base, ll exp)
{
        base %= MOD;
        int result = 1;
        while (exp > 0) {
        if (exp & 1) result = ((ll)result * base) % MOD;
        base = ((ll)base * base) % MOD;
        exp >>= 1;
      }
      return result;
}

// vi graph[N];
// void readGraph(ll m)
// {
//         int u,v;
//         FOR(i,0,m)
//         {
//             cin>>u>>v;
//             u--,v--;
//             graph[u].pb(v),graph[v].pb(u);
//         }
// }

int main()
{
        bhag_milkha
        int n,m,x,y;
        cin>>n>>m;
        int banned_row[n],banned_col[n];
        clr(banned_row),clr(banned_col);
        FOR(i,0,m)
        {
                cin>>x>>y;
                x--,y--;
                if(!x || x==n-1)
                banned_col[y] = 1;
                else if(!y || y==n-1)
                banned_row[x] = 1;
                else banned_row[x] = banned_col[y] = 1;
        }
        int ans = 0;
        FOR(i,1,n-1)
        {
                int v1 = 1 - banned_col[i];
                int v2 = 1 - banned_col[n-1-i];
                int h1 = 1 - banned_row[i];
                int h2 = 1 - banned_row[n-1-i];
                if(i==n-1-i)
                {
                        if(v1+v2) v1--;
                        if(h1+h2) h1--;
                }
                if(v1 + v2 > h1 + h2)
                {
                        banned_col[i] = banned_col[n-1-i] = 1;
                        ans += v1+v2;
                }
                else{
                        banned_row[i] = banned_row[n-1-i] = 1;
                        ans += h1+h2;
                }
        }
        cout<<ans;
        return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<string> vs;

#define FOR(i, a, n) for (int i = (a); a<n? i<n:i>n; a<n? i++:i--)
#define trav(a, x) for (auto& a : x)
#define all(x) x.begin(), x.end()
#define sortall(x) sort(all(x))
#define clr(x) memset(x, 0, sizeof(x))
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define deb(x) cout << #x << "=" << x << endl
#define lli ll
#define bhag_milkha ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const int MOD = 1000000007;
const int N = 2e5;

ll mpow(ll base, ll exp)
{
        base %= MOD;
        int result = 1;
        while (exp > 0) {
        if (exp & 1) result = ((ll)result * base) % MOD;
        base = ((ll)base * base) % MOD;
        exp >>= 1;
      }
      return result;
}

// vi graph[N];
// void readGraph(ll m)
// {
//         int u,v;
//         FOR(i,0,m)
//         {
//             cin>>u>>v;
//             u--,v--;
//             graph[u].pb(v),graph[v].pb(u);
//         }
// }

int main()
{
        bhag_milkha
        int n,m,x,y;
        cin>>n>>m;
        int banned_row[n],banned_col[n];
        clr(banned_row),clr(banned_col);
        FOR(i,0,m)
        {
                cin>>x>>y;
                x--,y--;
                if(!x || x==n-1)
                banned_col[y] = 1;
                else if(!y || y==n-1)
                banned_row[x] = 1;
                else banned_row[x] = banned_col[y] = 1;
        }
        map<int,int> diag1,diag2;
        int ans = 0;
        FOR(i,1,n-1)
        {
                if(!banned_row[i])
                {
                        int j = 0;
                        if(diag1.find(i-j)==diag1.end() && diag2.find(i+j)==diag2.end())
                        {
                                diag1[i-j] = diag2[i+j] = 1;
                                ans++ ;
                                continue;
                        }
                        j = n-1;
                        if(diag1.find(i-j)==diag1.end() && diag2.find(i+j)==diag2.end())
                        {
                                diag1[i-j] = diag2[i+j] = 1;
                                ans++ ;
                        }
                }
        }
        FOR(j,1,n-1)
        {
                if(!banned_col[j])
                {
                        int i = 0;
                        if(diag1.find(i-j)==diag1.end() && diag2.find(i+j)==diag2.end())
                        {
                                diag1[i-j] = diag2[i+j] = 1;
                                ans++ ;
                                continue;
                        }
                        i = n-1;
                        if(diag1.find(i-j)==diag1.end() && diag2.find(i+j)==diag2.end())
                        {
                                diag1[i-j] = diag2[i+j] = 1;
                                ans++ ;
                        }
                }
        }
        cout<<ans;
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define all(x) (x).begin(), (x).end()
#define tr(x,it) for(auto it = x.begin();it!=x.end();++it)
#define fpresent(x,c) ((c).find(x) != (c).end())  //set,map
#define present(c,x) (find(all(c),x) != (c).end()) //vector
#define pb push_back
#define mp make_pair
#define N 100001
template< class T > T max3(const T &a, const T &b, const T &c) { return max(a, max(b, c)); }
template< class T > T min3(const T &a, const T &b, const T &c) { return min(a, min(b, c)); }
template< class T > T gcd(const T a, const T b) { return (b ? gcd<T>(b, a%b) : a); }
template< class T > T lcm(const T a, const T b) { return (a / gcd<T>(a, b) * b); }

int main()
{
	ll n,m,i=0,j=-1,k;
	cin>>n>>m;
	ll row[n+1]={0},col[n+1]={0};
	for(i=0;i<m;i++)
	{
		cin>>j>>k;
		row[j]=1;
		col[k]=1;
	}
	ll ans=0;
	for(i=2;i<n;i++)
	{
		if(!row[i] || !col[i])
			ans++;
	}
	cout<<ans<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define all(x) (x).begin(), (x).end()
#define tr(x,it) for(auto it = x.begin();it!=x.end();++it)
#define fpresent(x,c) ((c).find(x) != (c).end())  //set,map
#define present(c,x) (find(all(c),x) != (c).end()) //vector
#define pb push_back
#define mp make_pair
#define N 100001
template< class T > T max3(const T &a, const T &b, const T &c) { return max(a, max(b, c)); }
template< class T > T min3(const T &a, const T &b, const T &c) { return min(a, min(b, c)); }
template< class T > T gcd(const T a, const T b) { return (b ? gcd<T>(b, a%b) : a); }
template< class T > T lcm(const T a, const T b) { return (a / gcd<T>(a, b) * b); }

int main()
{
	ll n,m,i=0,j=-1,k;
	cin>>n>>m;
	ll row[n+1]={0},col[n+1]={0},row2[n+1]={0},col2[n+1]={0};
	for(i=0;i<m;i++)
	{
		cin>>j>>k;
		row[j]=1;
		col[k]=1;
		row2[j]=1;
		col2[ k]=1;
	}
	ll ans=0;
	for(i=2;i<n;i++)
	{
		if(!row[i] || !row2[i])
		{
			ans++,row[i]=1,col[i]=1;
			row2[i]=1,col2[n+1-i]=1;
			if(!col[n+1-i] && i!=n-i+1)
				ans++,row[n+1-i]=1,col[n+1-i]=1;
			if(!col2[i])
				ans++,row[n+1-i]=1,col2[i]=1;
		}
		else if(!col[i] || !col2[i])
		{
			ans++,row[i]=1,col[i]=1;
			col2[i]=1,row2[n+1-i]=1;
			if(!row[n+1-i] && i!=n-i+1)
				ans++,row[n+1-i]=col[n+1-i]=1;
			if(!row2[i])
				ans++,row2[i]=col[n+1-i]=1;
		}
		// cout<<ans<</endl;
	}
	cout<<ans<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define all(x) (x).begin(), (x).end()
#define tr(x,it) for(auto it = x.begin();it!=x.end();++it)
#define fpresent(x,c) ((c).find(x) != (c).end())  //set,map
#define present(c,x) (find(all(c),x) != (c).end()) //vector
#define pb push_back
#define mp make_pair
#define N 100001
template< class T > T max3(const T &a, const T &b, const T &c) { return max(a, max(b, c)); }
template< class T > T min3(const T &a, const T &b, const T &c) { return min(a, min(b, c)); }
template< class T > T gcd(const T a, const T b) { return (b ? gcd<T>(b, a%b) : a); }
template< class T > T lcm(const T a, const T b) { return (a / gcd<T>(a, b) * b); }

int main()
{
	ll n,m,i=0,j=-1,k;
	cin>>n>>m;
	ll row[n+1]={0},col[n+1]={0},row2[n+1]={0},col2[n+1]={0};
	for(i=0;i<m;i++)
	{
		cin>>j>>k;
		row[j]=1;
		col[k]=1;
		row2[j]=1;
		col2[k]=1;
	}
	ll ans=0;
	for(i=2;i<n;i++)
	{
		if(!row[i] || !row2[i])
		{
			ans++,row[i]=1,col[i]=1;
			row2[i]=1,col2[n+1-i]=1;
			if(!col[n+1-i] && i!=n-i+1)
				ans++,row[n+1-i]=1,col[n+1-i]=1;
			if(!col2[i])
				ans++,row[n+1-i]=1,col2[i]=1;
		}
		else if(!col[i] || !col2[i])
		{
			ans++,row[i]=1,col[i]=1;
			col2[i]=1,row2[n+1-i]=1;
			if(!row[n+1-i] && i!=n-i+1)
				ans++,row[n+1-i]=col[n+1-i]=1;
			if(!row2[i])
				ans++,row2[i]=col[n+1-i]=1;
		}
		// cout<<ans<</endl;
	}
	cout<<ans<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define all(x) (x).begin(), (x).end()
#define tr(x,it) for(auto it = x.begin();it!=x.end();++it)
#define fpresent(x,c) ((c).find(x) != (c).end())  //set,map
#define present(c,x) (find(all(c),x) != (c).end()) //vector
#define pb push_back
#define mp make_pair
#define N 100001
template< class T > T max3(const T &a, const T &b, const T &c) { return max(a, max(b, c)); }
template< class T > T min3(const T &a, const T &b, const T &c) { return min(a, min(b, c)); }
template< class T > T gcd(const T a, const T b) { return (b ? gcd<T>(b, a%b) : a); }
template< class T > T lcm(const T a, const T b) { return (a / gcd<T>(a, b) * b); }

int main()
{
	ll n,m,i=0,j=-1,k;
	cin>>n>>m;
	ll row[n+1]={0},col[n+1]={0};
	for(i=0;i<m;i++)
	{
		cin>>j>>k;
		row[j]=1;
		col[k]=1;
	}
	ll ans=0;
	for(i=2;i<n;i++)
	{
		if(!row[i])
		{
			ans++,row[i]=1,col[i]=1;
			if(!col[n-i] && i!=n-i+1)
				ans++,row[n-i]=1,col[n-i]=1;
		}
		else if(!col[i] && i!=n-i+1)
		{
			ans++,row[i]=1,col[i]=1;
			if(!row[n-i])
				ans++,row[n-i]=col[n-i]=1;
		}
	}
	cout<<ans<<endl;
	return 0;
}


#include<bits/stdc++.h>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ba back
#define ppb pop_back
#define eb emplace_back

#define sz(x) (int((x.size())))
#define all(x) (x).begin(),(x).end()

#define db(x)        cerr << #x << " = " << x << endl
#define db2(x, y)   {cerr << #x << " = " << x << "\t";  db(y);}
#define db3(x, y, z){cerr << #x << " = " << x << "\t";  db2(y,z);}

#define si(a) scanf("%d", &a)
#define sii(a, b) scanf("%d%d", &a, &b)
#define siii(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define sl(a) scanf("%I64d", &a)
#define sll(a, b) scanf("%I64d%I64d", &a, &b)
#define slll(a, b, c) scanf("%I64d%I64d%I64d", &a, &b, &c)

#define bye exit(0)
#define FAST ios_base :: sync_with_stdio (false); cin.tie (NULL)

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;

const int MOD = 1e9 + 7;

int add(int x, int y, int CMOD=MOD){return (0LL + x + y)%CMOD;}
int mult(int x, int y, int CMOD=MOD){return (1LL*x*y) % CMOD;}
ll fast_expo(ll x, ll y, ll CMOD=MOD){
    if(x==0) return 0;
    if(y==0) return 1;
    ll ans = fast_expo(x, y/2, CMOD);
    ans = mult(ans, ans, CMOD);
    if(y&1) ans = mult(ans, x, CMOD);
    return ans;
}

const int TAM = 1e5 + 100;
const ll INF = LLONG_MAX/4;

set<int>f, c;

int main(){
    int n, m; sii(n, m);
    for(int i=2; i<n; i++) f.insert(i), c.insert(i);

    for(int i=0; i<m; i++){
        int x, y; sii(x, y);
        f.erase(x);
        c.erase(y);
    }
    cout << c.size() +  f.size() << endl;

    return 0;
}


#include<bits/stdc++.h>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ba back
#define ppb pop_back
#define eb emplace_back

#define sz(x) (int((x.size())))
#define all(x) (x).begin(),(x).end()

#define db(x)        cerr << #x << " = " << x << endl
#define db2(x, y)   {cerr << #x << " = " << x << "\t";  db(y);}
#define db3(x, y, z){cerr << #x << " = " << x << "\t";  db2(y,z);}

#define si(a) scanf("%d", &a)
#define sii(a, b) scanf("%d%d", &a, &b)
#define siii(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define sl(a) scanf("%I64d", &a)
#define sll(a, b) scanf("%I64d%I64d", &a, &b)
#define slll(a, b, c) scanf("%I64d%I64d%I64d", &a, &b, &c)

#define bye exit(0)
#define FAST ios_base :: sync_with_stdio (false); cin.tie (NULL)

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;

const int MOD = 1e9 + 7;

int add(int x, int y, int CMOD=MOD){return (0LL + x + y)%CMOD;}
int mult(int x, int y, int CMOD=MOD){return (1LL*x*y) % CMOD;}
ll fast_expo(ll x, ll y, ll CMOD=MOD){
    if(x==0) return 0;
    if(y==0) return 1;
    ll ans = fast_expo(x, y/2, CMOD);
    ans = mult(ans, ans, CMOD);
    if(y&1) ans = mult(ans, x, CMOD);
    return ans;
}

const int TAM = 1e5 + 100;
const ll INF = LLONG_MAX/4;

set<ii>c;
//

int main(){
    int n, m; sii(n, m);
    for(int i=2; i<n; i++){
        c.insert({1, i}), c.insert({n, i});
        c.insert({i, 1}), c.insert({i, n});
    }

    for(int i=0; i<m; i++){
        int x, y; sii(x, y);
        c.erase({x, 1}); c.erase({x, n});
        c.erase({1, y}); c.erase({n, y});
    }
    int ans = 0;
    while(c.size() > 0){
        int x = (*c.begin()).fi;
        int y = (*c.begin()).se;

        //cout << x << " " << y << endl;

        c.erase({x, 1}); c.erase({x, n});
        c.erase({1, y}); c.erase({n, y});
        //db2(x, 1);
        //db2(x, n);
        //db2(1, y);
        //db2(n, y);

        c.erase({y, x}); c.erase({n+1-y, n+1-x});
        //db2(y, x);
        //db2(n+1-y, n+1-x);

        ans++;
    }
    cout << ans << endl;

    return 0;
}


#include<bits/stdc++.h>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ba back
#define ppb pop_back
#define eb emplace_back

#define sz(x) (int((x.size())))
#define all(x) (x).begin(),(x).end()

#define db(x)        cerr << #x << " = " << x << endl
#define db2(x, y)   {cerr << #x << " = " << x << "\t";  db(y);}
#define db3(x, y, z){cerr << #x << " = " << x << "\t";  db2(y,z);}

#define si(a) scanf("%d", &a)
#define sii(a, b) scanf("%d%d", &a, &b)
#define siii(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define sl(a) scanf("%I64d", &a)
#define sll(a, b) scanf("%I64d%I64d", &a, &b)
#define slll(a, b, c) scanf("%I64d%I64d%I64d", &a, &b, &c)

#define bye exit(0)
#define FAST ios_base :: sync_with_stdio (false); cin.tie (NULL)

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;

const int MOD = 1e9 + 7;

int add(int x, int y, int CMOD=MOD){return (0LL + x + y)%CMOD;}
int mult(int x, int y, int CMOD=MOD){return (1LL*x*y) % CMOD;}
ll fast_expo(ll x, ll y, ll CMOD=MOD){
    if(x==0) return 0;
    if(y==0) return 1;
    ll ans = fast_expo(x, y/2, CMOD);
    ans = mult(ans, ans, CMOD);
    if(y&1) ans = mult(ans, x, CMOD);
    return ans;
}

const int TAM = 1e5 + 100;
const ll INF = LLONG_MAX/4;

set<int>f, c;

int main(){
    int n, m; sii(n, m);
    for(int i=2; i<n; i++) f.insert(i), c.insert(i);

    for(int i=0; i<m; i++){
        int x, y; sii(x, y);
        f.erase(x);
        c.erase(y);
    }
    cout << max(c.size(), f.size()) << endl;

    return 0;
}


#include<bits/stdc++.h>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ba back
#define ppb pop_back
#define eb emplace_back

#define sz(x) (int((x.size())))
#define all(x) (x).begin(),(x).end()

#define db(x)        cerr << #x << " = " << x << endl
#define db2(x, y)   {cerr << #x << " = " << x << "\t";  db(y);}
#define db3(x, y, z){cerr << #x << " = " << x << "\t";  db2(y,z);}

#define si(a) scanf("%d", &a)
#define sii(a, b) scanf("%d%d", &a, &b)
#define siii(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define sl(a) scanf("%I64d", &a)
#define sll(a, b) scanf("%I64d%I64d", &a, &b)
#define slll(a, b, c) scanf("%I64d%I64d%I64d", &a, &b, &c)

#define bye exit(0)
#define FAST ios_base :: sync_with_stdio (false); cin.tie (NULL)

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;

const int MOD = 1e9 + 7;

int add(int x, int y, int CMOD=MOD){return (0LL + x + y)%CMOD;}
int mult(int x, int y, int CMOD=MOD){return (1LL*x*y) % CMOD;}
ll fast_expo(ll x, ll y, ll CMOD=MOD){
    if(x==0) return 0;
    if(y==0) return 1;
    ll ans = fast_expo(x, y/2, CMOD);
    ans = mult(ans, ans, CMOD);
    if(y&1) ans = mult(ans, x, CMOD);
    return ans;
}

const int TAM = 1e5 + 100;
const ll INF = LLONG_MAX/4;

set<ii>c;
//

int main(){
    int n, m; sii(n, m);
    for(int i=2; i<n; i++){
        c.insert({1, i}), c.insert({n, i});
        c.insert({i, 1}), c.insert({i, n});
    }

    for(int i=0; i<m; i++){
        int x, y; sii(x, y);
        c.erase({x, 1}); c.erase({x, n});
        c.erase({1, y}); c.erase({n, y});
    }
    int ans = 0;
    for(int X = 2; X<n; X++){
        set<ii> p;
        p.insert({1, X});
        p.insert({X, n});
        p.insert({n+1-X, 1});
        p.insert({n, n+1-X});

        for(auto rr: p){
            int x = rr.fi;
            int y = rr.se;
            if(c.find({x, y})!=c.end()){
                ans++;
                c.erase({x, 1}); c.erase({x, n});
                c.erase({1, y}); c.erase({n, y});
                //db2(x, 1);
                //db2(x, n);
                //db2(1, y);
                //db2(n, y);

                c.erase({y, x}); c.erase({n+1-y, n+1-x});
                //db2(y, x);
                //db2(n+1-y, n+1-x);
            }
        }
    }
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define inf 100000000
#define p 31
#define MOD 1000000007
#define maxn 100010
#define pb push_back
#define pll pair<ll,ll>
#define vi vector<ll>
#define vvi vector<vector<ll> >
#define vii vector<pll>
#define vvpll vector<vector<pll> >
#define vpll vector<pll>
#define all(v) (v).begin(),(v).end()

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll n,m,x,y;
	cin>>n>>m;
	bool cols[n+1]={0},rows[n+1]={0};
	for(int i=0;i<m;i++)
	{
		cin>>x>>y;
		cols[y]=1;
		rows[x]=1;
	}
	ll ans=0;
	for(int i=2;i<=n-1;i++)
	{
		if(n%2==0||i!=n/2+1){
			if(rows[i]==0&&cols[i]==0)
			{
				ans+=2;
			}else if(rows[i]==0||cols[i]==0){
				ans++;
			}
		}else{
			if(rows[i]==0||cols[i]==0)
			{
				ans++;
			}
		}
	}
	cout<<ans;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define inf 100000000
#define p 31
#define MOD 1000000007
#define maxn 100010
#define pb push_back
#define pll pair<ll,ll>
#define vi vector<ll>
#define vvi vector<vector<ll> >
#define vii vector<pll>
#define vvpll vector<vector<pll> >
#define vpll vector<pll>
#define all(v) (v).begin(),(v).end()

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll n,m,x,y;
	cin>>n>>m;
	bool cols[n+1]={0},rows[n+1]={0};
	for(int i=0;i<m;i++)
	{
		cin>>x>>y;
		cols[y]=1;
		rows[x]=1;
	}
	ll ans=0;
	for(int i=2;i<=n-1;i++)
	{
		if(rows[i]==0||cols[i]==0)
		{
			ans++;
		}
	}
	cout<<ans;
}


#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    int n, m;
    vector<bool> blockedRow, blockedCol;

    cin>>n>>m;
    blockedRow.resize(n, false);
    blockedCol.resize(n, false);

    int x, y;
    for (int i=0; i<m; ++i)
        cin>>x>>y,
        blockedRow[x-1] = true,
        blockedCol[y-1] = true;

    int ans = 0;
    for (int i=1; i<n/2; ++i)
    {
        // c(n-c-1)
        // 01
        //7XX2 r
        //6XX3 (n-r-1)
        // 54
        int bestChoice = 0;
        for (int on=1; on<=4; ++on)
        {
            bool madeChoice = false;
            vector<bool> choice(8, false);
            for (int i=0; i<on; ++i)
                choice[8-i-1] = true;

            do
            {
                if (choice[0] && choice[3]) continue;
                if (choice[0] && choice[5]) continue;
                if (choice[0] && choice[7]) continue;
                if (choice[1] && choice[2]) continue;
                if (choice[1] && choice[4]) continue;
                if (choice[1] && choice[6]) continue;
                if (choice[2] && choice[5]) continue;
                if (choice[2] && choice[7]) continue;
                if (choice[3] && choice[4]) continue;
                if (choice[3] && choice[6]) continue;
                if (choice[4] && choice[7]) continue;
                if (choice[5] && choice[6]) continue;

                if (choice[0] && blockedCol[i]) continue;
                if (choice[1] && blockedCol[n-i-1]) continue;
                if (choice[2] && blockedRow[i]) continue;
                if (choice[3] && blockedRow[n-i-1]) continue;
                if (choice[4] && blockedCol[n-i-1]) continue;
                if (choice[5] && blockedCol[i]) continue;
                if (choice[6] && blockedRow[n-i-1]) continue;
                if (choice[7] && blockedRow[i]) continue;

                // cout<<"good choice: ";
                // for (int i=0; i<choice.size(); ++i)
                //     if (choice[i]) cout<<'1';
                //     else cout<<'0';
                // cout<<endl;

                bestChoice = on;
                madeChoice = true;
            } while (!madeChoice && next_permutation(choice.begin(), choice.end()));
        }

        ans += bestChoice;
    }

    if (n%2 == 1)
    {
        int x = n/2+1;
        if (blockedRow[x] || blockedCol[x])
            ans += 1;
    }

    cout<<ans<<endl;
    return 0;
}


#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    int n, m;
    vector<bool> blockedRow, blockedCol;

    cin>>n>>m;
    blockedRow.resize(n, false);
    blockedCol.resize(n, false);

    int x, y;
    for (int i=0; i<m; ++i)
        cin>>x>>y,
        blockedRow[x-1] = true,
        blockedCol[y-1] = true;

    int ans = 0;
    for (int i=1; i<n/2-1; ++i)
    {
        // c(n-c-1)
        // 01
        //7XX2 r
        //6XX3 (n-r-1)
        // 54
        int bestChoice = 0;
        for (int on=1; on<=4; ++on)
        {
            bool madeChoice = false;
            vector<bool> choice(8, false);
            for (int i=0; i<on; ++i)
                choice[8-i-1] = true;

            do
            {
                if (choice[0] && choice[3]) continue;
                if (choice[0] && choice[5]) continue;
                if (choice[0] && choice[7]) continue;
                if (choice[1] && choice[2]) continue;
                if (choice[1] && choice[4]) continue;
                if (choice[1] && choice[6]) continue;
                if (choice[2] && choice[5]) continue;
                if (choice[2] && choice[7]) continue;
                if (choice[3] && choice[4]) continue;
                if (choice[3] && choice[6]) continue;
                if (choice[4] && choice[7]) continue;
                if (choice[5] && choice[6]) continue;

                if (choice[0] && blockedCol[i]) continue;
                if (choice[1] && blockedCol[n-i-1]) continue;
                if (choice[2] && blockedRow[i]) continue;
                if (choice[3] && blockedRow[n-i-1]) continue;
                if (choice[4] && blockedCol[n-i-1]) continue;
                if (choice[5] && blockedCol[i]) continue;
                if (choice[6] && blockedRow[n-i-1]) continue;
                if (choice[7] && blockedRow[i]) continue;

                // cout<<"good choice: ";
                // for (int i=0; i<choice.size(); ++i)
                //     if (choice[i]) cout<<'1';
                //     else cout<<'0';
                // cout<<endl;

                bestChoice = on;
                madeChoice = true;
            } while (!madeChoice && next_permutation(choice.begin(), choice.end()));
        }

        ans += bestChoice;
    }

    if (n%2 == 1)
    {
        int x = n/2;
        if (!blockedRow[x] || !blockedCol[x])
            ans += 1;
    }

    cout<<ans<<endl;
    return 0;
}


#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    int n, m;
    vector<bool> blockedRow, blockedCol;

    cin>>n>>m;
    blockedRow.resize(n, false);
    blockedCol.resize(n, false);

    int x, y;
    for (int i=0; i<m; ++i)
        cin>>x>>y,
        blockedRow[x-1] = true,
        blockedCol[y-1] = true;

    int ans = 0;
    for (int i=1; i<n/2; ++i)
    {
        // c(n-c-1)
        // 01
        //7XX2 r
        //6XX3 (n-r-1)
        // 54
        int bestChoice = 0;
        for (int on=1; on<=4; ++on)
        {
            bool madeChoice = false;
            vector<bool> choice(8, false);
            for (int i=0; i<on; ++i)
                choice[8-i-1] = true;

            do
            {
                if (choice[0] && choice[3]) continue;
                if (choice[0] && choice[5]) continue;
                if (choice[0] && choice[7]) continue;
                if (choice[1] && choice[2]) continue;
                if (choice[1] && choice[4]) continue;
                if (choice[1] && choice[6]) continue;
                if (choice[2] && choice[5]) continue;
                if (choice[2] && choice[7]) continue;
                if (choice[3] && choice[4]) continue;
                if (choice[3] && choice[6]) continue;
                if (choice[4] && choice[7]) continue;
                if (choice[5] && choice[6]) continue;

                // cout<<"sod far good choice: ";
                // for (int i=0; i<choice.size(); ++i)
                //     if (choice[i]) cout<<'1';
                //     else cout<<'0';
                // cout<<endl;

                if (choice[0] && blockedCol[i]) continue;
                if (choice[1] && blockedCol[n-i-1]) continue;
                if (choice[2] && blockedRow[i]) continue;
                if (choice[3] && blockedRow[n-i-1]) continue;
                if (choice[4] && blockedCol[n-i-1]) continue;
                if (choice[5] && blockedCol[i]) continue;
                if (choice[6] && blockedRow[n-i-1]) continue;
                if (choice[7] && blockedRow[i]) continue;

                // cout<<"good choice: ";
                // for (int i=0; i<choice.size(); ++i)
                //     if (choice[i]) cout<<'1';
                //     else cout<<'0';
                // cout<<endl;

                bestChoice = on;
                madeChoice = true;
            } while (!madeChoice && next_permutation(choice.begin(), choice.end()));
        }

        ans += bestChoice;
    }

    if (n%2 == 1)
    {
        int x = n/2;
        if (!blockedRow[x] || !blockedCol[x])
            ans += 1;
    }

    cout<<ans<<endl;
    return 0;
}


#include "bits/stdc++.h"
using namespace std;
typedef long long int LL;
template<typename T> using V = vector<T>;
#define fi first
#define se second
#define pb push_back
#define fo(i, n) for (int i = 0; i < (int)(n); ++i)
#define fr(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ro(i, a, b)		for (int i = (a); i <= (int)(b); ++i)
#define all(x) (x).begin(), (x).end()
#define	SZ(x)	(int)x.size()
#define ii	pair< int, int >
#define iii pair< int, ii >
#define ret return 0;
const int INF = 1e9 + 5;
const int MOD = (int)1e9 + 7;
const int maxn = 1e3 + 5;
const int maxm = 1e6 + 5;

int n, row[maxn], col[maxn], m;

int main() {
// ios::sync_with_stdio(false), cin.tie(0);
memset(row, -1, sizeof row);
memset(col, -1, sizeof col);
cin >> n >> m;
fo(i, m){int r, c;	cin >> r >> c;	row[r] = 0, col[c] = 0;	}
int ans = 0, r = 0, c = 0;
ro(i, 2, n - 1){
	// cout << i <<  ' ' << n - i + 1 << endl;
	if(i == n - i + 1){
		ans += min(1, -row[i] + -col[i] + -col[n - i + 1]);
	}
	else r += -row[i], c += -col[i] + -col[n - i + 1];
}
cout << ans + r + c / 2;
}


#include "bits/stdc++.h"
using namespace std;
typedef long long int LL;
template<typename T> using V = vector<T>;
#define fi first
#define se second
#define pb push_back
#define fo(i, n) for (int i = 0; i < (int)(n); ++i)
#define fr(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ro(i, a, b)		for (int i = (a); i <= (int)(b); ++i)
#define all(x) (x).begin(), (x).end()
#define	SZ(x)	(int)x.size()
#define ii	pair< int, int >
#define iii pair< int, ii >
#define ret return 0;
const int INF = 1e9 + 5;
const int MOD = (int)1e9 + 7;
const int maxn = 1e3 + 5;
const int maxm = 1e6 + 5;

int n, row[maxn], col[maxn], m;

int main() {
// ios::sync_with_stdio(false), cin.tie(0);
memset(row, -1, sizeof row);
memset(col, -1, sizeof col);
cin >> n >> m;
fo(i, m){int r, c;	cin >> r >> c;	row[r] = 0, col[c] = 0;	}
int ans = 0;
ro(i, 2, n - 1)ans += max(-row[i], max(-col[i], -col[n - i + 1]));
cout << ans;
}


#include "bits/stdc++.h"
using namespace std;
typedef long long int LL;
template<typename T> using V = vector<T>;
#define fi first
#define se second
#define pb push_back
#define fo(i, n) for (int i = 0; i < (int)(n); ++i)
#define fr(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ro(i, a, b)		for (int i = (a); i <= (int)(b); ++i)
#define all(x) (x).begin(), (x).end()
#define	SZ(x)	(int)x.size()
#define ii	pair< int, int >
#define iii pair< int, ii >
#define ret return 0;
const int INF = 1e9 + 5;
const int MOD = (int)1e9 + 7;
const int maxn = 1e3 + 5;
const int maxm = 1e6 + 5;

int n, row[maxn], col[maxn], m;

int main() {
// ios::sync_with_stdio(false), cin.tie(0);
memset(row, -1, sizeof row);
memset(col, -1, sizeof col);
cin >> n >> m;
fo(i, m){int r, c;	cin >> r >> c;	row[r] = 0, col[c] = 0;	}
int ans = 0;
ro(i, 2, n - 1){
	// cout << i <<  ' ' << n - i + 1 << endl;
	if(i == n - i + 1){
		ans += min(1, -row[i] + -col[i] + -col[n - i + 1]);
	}
	else ans += -row[i] + -col[i] + -col[n - i + 1];
	i++;
}
cout << ans;
}


#include "bits/stdc++.h"
using namespace std;
typedef long long int LL;
template<typename T> using V = vector<T>;
#define fi first
#define se second
#define pb push_back
#define fo(i, n) for (int i = 0; i < (int)(n); ++i)
#define fr(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ro(i, a, b)		for (int i = (a); i <= (int)(b); ++i)
#define all(x) (x).begin(), (x).end()
#define	SZ(x)	(int)x.size()
#define ii	pair< int, int >
#define iii pair< int, ii >
#define ret return 0;
const int INF = 1e9 + 5;
const int MOD = (int)1e9 + 7;
const int maxn = 1e3 + 5;
const int maxm = 1e6 + 5;

int n, row[maxn], col[maxn], m;

int main() {
// ios::sync_with_stdio(false), cin.tie(0);
memset(row, -1, sizeof row);
memset(col, -1, sizeof col);
cin >> n >> m;
fo(i, m){int r, c;	cin >> r >> c;	row[r] = 0, col[c] = 0;	}
int ans = 0;
ro(i, 2, n - 1)ans += max(-row[i], -col[i]);
cout << ans;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<b;i++)
#define repr(i,a,b) for(int i=(a);i>b;i--)
#define all(x) (x).begin(),(x).end()
#define int long long int
#define sz size()
#define nl '\n'
#define ll long long
using namespace std;

int n, m;
const int N=1002;
int arr[N][N];

void solve(){

    cin>>n>>m;

    rep(i,0,m) {
        int x,y;
        cin>>x>>y;
        arr[x][y]=1;
    }

    int ans=0;

    int ct=0;
    unordered_set<int> rows,colms;

    rep(i,2,n) rows.insert(i);
    rep(i,2,n){
        rep(j,2,n) if(arr[i][j]) {
            rows.erase(i);
            break;
        }
    }

    rep(j,2,n){
        rep(i,2,n) if(arr[i][j]) {
                colms.insert(j);
                break;
            }
    }
    ans= rows.size();
    rep(i,2,n){
        if(colms.find(i)==colms.end()){
            if(rows.find(i)==rows.end()) ans++,colms.insert(i);
            else if(colms.find(n-i+1)!=colms.end()) ans++,colms.insert(n-i+1);
            else if(rows.find(n-i+1)==rows.end()) ans++;

        }
    }
    cout<<ans;
}

signed main(){

#ifdef AKP
    freopen("in.txt","r",stdin);
   // freopen("out.txt","w",stdout);
#endif

    ios::sync_with_stdio(0),cin.tie(0);
    int tt=1;
    //cin>>tt;
    rep(i,0,tt) solve();

    return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<b;i++)
#define repr(i,a,b) for(int i=(a);i>b;i--)
#define all(x) (x).begin(),(x).end()
#define int long long int
#define sz size()
#define nl '\n'
#define ll long long
using namespace std;

int n, m;
const int N=1002;
int arr[N][N];

void solve(){

    cin>>n>>m;

    rep(i,0,m) {
        int x,y;
        cin>>x>>y;
        arr[x][y]=1;
    }

    int ans=0;

    int ct=0;
    unordered_set<int> rows,colms;

    rep(i,2,n){
        rep(j,2,n) if(arr[i][j]) {
            rows.insert(i);
            break;
        }
    }

    rep(j,2,n){
        rep(i,2,n) if(arr[i][j]) {
                colms.insert(j);
                break;
            }
    }
    ans = (2*n - 4 -rows.size()-colms.size());
    if(n&1) {
        int ck=n/2 + 1;
        if(arr[ck][ck] or (rows.find(ck)!=rows.end() and colms.find(ck)!=colms.end()))
            ans++;
        else if(rows.find(ck)==rows.end() and colms.find(ck)==colms.end())
            ans--;
    }
    cout<<ans;

}

signed main(){

#ifdef AKP
    freopen("in.txt","r",stdin);
   // freopen("out.txt","w",stdout);
#endif

    ios::sync_with_stdio(0),cin.tie(0);
    int tt=1;
    //cin>>tt;
    rep(i,0,tt) solve();

    return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<b;i++)
#define repr(i,a,b) for(int i=(a);i>b;i--)
#define all(x) (x).begin(),(x).end()
#define int long long int
#define sz size()
#define nl '\n'
#define ll long long
using namespace std;

int n, m;
const int N=1002;
int arr[N][N];

void solve(){

    cin>>n>>m;

    rep(i,0,m) {
        int x,y;
        cin>>x>>y;
        arr[x][y]=1;
    }

    int ans=0;

    int ct=0;
    unordered_set<int> rows,colms;

    rep(i,2,n){
        rep(j,2,n) if(arr[i][j]) {
            rows.insert(i);
            break;
        }
    }

    rep(j,2,n){
        rep(i,2,n) if(arr[i][j]) {
                colms.insert(j);
                break;
            }
    }
    ans = (2*n - 4 -rows.size()-colms.size());
    if(n&1) {
        int ck=n/2 + 1;

        if(rows.find(ck)==rows.end() and colms.find(ck)==colms.end())
            ans--;

    }
    cout<<ans;

}

signed main(){

#ifdef AKP
    freopen("in.txt","r",stdin);
   // freopen("out.txt","w",stdout);
#endif

    ios::sync_with_stdio(0),cin.tie(0);
    int tt=1;
    //cin>>tt;
    rep(i,0,tt) solve();

    return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<b;i++)
#define repr(i,a,b) for(int i=(a);i>b;i--)
#define all(x) (x).begin(),(x).end()
#define int long long int
#define sz size()
#define nl '\n'
#define ll long long
using namespace std;

int n, m;
const int N=1002;
int arr[N][N];

void solve(){

    cin>>n>>m;

    rep(i,0,m) {
        int x,y;
        cin>>x>>y;
        arr[x][y]=1;
    }

    int ans=0;

    int ct=0;
    unordered_set<int> rows,colms;

    rep(i,2,n){
        rep(j,1,n+1) if(arr[i][j]) {
            rows.insert(i);
            break;
        }
    }

    rep(j,2,n){
        rep(i,1,n+1) if(arr[i][j]) {
                colms.insert(j);
                break;
            }
    }
    ans = (2*n - 4 -rows.size()-colms.size());
    if(n&1) {
        int ck=n/2 + 1;

        if(rows.find(ck)==rows.end() and colms.find(ck)==colms.end())
            ans--;

    }
    cout<<ans;

}

signed main(){

#ifdef AKP
    freopen("in.txt","r",stdin);
   // freopen("out.txt","w",stdout);
#endif

    ios::sync_with_stdio(0),cin.tie(0);
    int tt=1;
    //cin>>tt;
    rep(i,0,tt) solve();

    return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<b;i++)
#define repr(i,a,b) for(int i=(a);i>b;i--)
#define all(x) (x).begin(),(x).end()
#define int long long int
#define sz size()
#define nl '\n'
#define ll long long
using namespace std;

int n, m;
const int N=1002;
int arr[N][N];

void solve(){

    cin>>n>>m;

    rep(i,0,m) {
        int x,y;
        cin>>x>>y;
        arr[x][y]=1;
    }

    int ans=0;

    int ct=0;
    unordered_set<int> rows,colms;

    rep(i,2,n) rows.insert(i);
    rep(i,2,n){
        rep(j,2,n) if(arr[i][j]) {
            rows.erase(i);
            break;
        }
    }

    rep(j,2,n){
        rep(i,2,n) if(arr[i][j]) {
                colms.insert(j);
                break;
            }
    }
    ans= rows.size();
    rep(i,2,n){
        if(rows.find(i)==rows.end() and colms.find(i)==colms.end()) ans++;
    }
    cout<<ans;
}

signed main(){

#ifdef AKP
    freopen("in.txt","r",stdin);
#endif

    ios::sync_with_stdio(0),cin.tie(0);
    int tt=1;
    //cin>>tt;
    rep(i,0,tt) solve();

    return 0;
}


    #include <bits/stdc++.h>
using namespace std;
int r[1001],c[1001];
int main()
{
     ios_base::sync_with_stdio(false);
     cin.tie(0);
     cout.tie(0);
    int n,m,cnt=0;
    cin>>n>>m;
    for(int i=1;i<=m;i++)
    {int x,y;
        cin>>x>>y;
        r[x]=1;
        c[y]=1;
    }
    for(int i=2;i<n;i++)
    {
        if(r[i]==0)
        cnt++;
        if(c[i]==0)
        cnt++;
    }

    if(n%2!=0 && r[(n+1)/2]==0 && c[(n+1)/2]==0)
    cnt--;
    cout<<cnt;
}


#include <algorithm>
#include <iostream>
#include <memory.h>
#include <iomanip>
#include <utility>
#include <cstdio>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <list>
#include <map>
#include <set>

#define fr first
#define sc second
#define mk make_pair
#define pb push_back
#define int unsigned long long
#define all(s) s.begin(), s.end()

using namespace std;

const int N = 1*1e3+1;

int n, m;
int x, y;
int ur[N], uc[N];
int ans;

main()
{
        cin >> n >> m;

        for(int i = 1 ; i <= m ; i ++)
        {
                cin >> x >> y;
                uc[x] = 1;
                ur[y] = 1;
        }

        for(int i = 2, y = 4 ; i <= n / 2 ; i ++)
        {
                if(uc[i])
                        y --;
                if(uc[n - i + 1])
                        y --;
                if(ur[i])
                        y --;
                if(ur[n - i + 1])
                        y --;
                ans += y;
        }

        if(n % 2 == 1)
        {
                if(!uc[n / 2 + 1] || !ur[n / 2 + 1])
                        ans ++;
        }
        cout << ans << endl;
}


#include <algorithm>
#include <iostream>
#include <memory.h>
#include <iomanip>
#include <utility>
#include <cstdio>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <list>
#include <map>
#include <set>

#define fr first
#define sc second
#define mk make_pair
#define pb push_back
#define ll unsigned long long
#define all(s) s.begin(), s.end()

using namespace std;

const int N = 1*1e3+1;

int n, m;
int x, y;
int ur[N], uc[N];
int ans;

main()
{
        cin >> n >> m;

        for(int i = 1 ; i <= m ; i ++)
        {
                cin >> x >> y;
                uc[x] = 1;
                ur[y] = 1;
        }

        for(int i = 2, y = 4 ; i <= n / 2 ; i ++)
        {
                if(uc[i])
                        y --;
                if(uc[n - i + 1])
                        y --;
                if(ur[i])
                        y --;
                if(ur[n - i + 1])
                        y --;
                ans += y;
        }

        if(n % 2 == 1)
        {
                if(!uc[n / 2 + 1] || !ur[n / 2 + 1])
                        ans ++;
        }
        cout << ans << endl;
}


#include <algorithm>
#include <iostream>
#include <memory.h>
#include <iomanip>
#include <utility>
#include <cstdio>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <list>
#include <map>
#include <set>

#define fr first
#define sc second
#define mk make_pair
#define pb push_back
#define ll unsigned long long
#define all(s) s.begin(), s.end()

using namespace std;

const int N = 1*1e3+1;

int n, m;
int x, y;
int ur[N], uc[N];
int ans;

main()
{
        cin >> n >> m;

        for(int i = 1 ; i <= m ; i ++)
        {
                cin >> x >> y;
                uc[x] = 1;
                ur[y] = 1;
        }

        for(int i = 2 ; i <= n / 2 ; i ++)
        {
                ans += 4 - (uc[i] + ur[i] + ur[n - i + 1] + uc[n - i + 1]);
        }

        if(n % 2 == 1)
        {
                if(!uc[n / 2 + 1] || !ur[n / 2 + 1])
                        ans ++;
        }
        cout << ans << endl;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
/*
#define cin fin
#define cout fout

ifstream fin("input.txt");
ofstream fout("output.txt");*/

#define SI(x) cin>>x
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define FI(w, x, y, z) cin>>w>>x>>y>>z

#define SO(x) cout<<x<<endl
#define DO(x, y) cout<<x<<" "<<y<<endl
#define TO(x, y, z) cout<<x<<" "<<y<<" "<<z<<endl
#define FO(w, x, y, z) cout<<w<<" "<<x<<" "<<y<<" "<<z<<endl

#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

#define pr pair<lli, lli>
//#define V(x) vector<x>
#define pb(x) push_back(x)
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend());
#define mp(x, y) make_pair(x, y)
#define fi first
#define se second
#define mll(x, y) map<lli x, lli y>

#define F(i, a, n) for(i=a;i<n;i++)
#define B(i, a, n) for(i=n-1;i>=a;i--)

#define mod 1000000007
#define pi 3.141592653589793238

//GCD
lli gcd(lli a, lli b){
    if(b < a)    {
        lli temp = a;
        a = b;
        b = temp;
    }
    if(a == 0){
        return b;
    }
    return gcd(b%a,a);
}
lli max(lli a, lli b){
    if(a>b)
        return a;
    return b;
}
//LCM
lli lcm(lli a, lli b){
    return (a*b/gcd(a,b));
}

//Factorial
lli fact(lli x){
    lli ans = 1;
    if(x == 0){
        return 1;
    }
    while(x > 0){
        ans = (ans*x)%mod;
        x--;
    }
    return ans%mod;
}
//C(n, r)
lli comb(lli n, lli r){
    lli x=fact(r), y=fact(n-r);
    x=(x*y)%mod;
    if(fact(n)>x)
        return fact(n)/x;
    return (fact(n)+mod)/x;
}
lli power(lli a, lli p)
{
    lli ans = 1;
    while(p > 0)
    {
        if(p%2)
        {
            ans *= a;
            ans %= 1000000007;
        }
        a*=a;
        a%=1000000007;
        p/=2;
    }
    return ans%1000000007;
}
lli dist(lli x1, lli y1, lli x2, lli y2){
    return (1.0*(x1-x2)*(x1-x2) + 1.0*(y1-y2)*(y1-y2));
}
//binary of a number
vector <lli> getbinary(lli x){
    vector <lli> bin(20000,0);
    lli iter = 0;
    while(x > 0){
        if(x%2 == 1){
            bin[iter] = 1;
        }
        else{
            bin[iter] = 0;
        }
        iter++;
        x/=2;
    }
    return bin;
}
int main(){
    lli n, m, i, x, y;
    DI(n, m);
    lli a[n+1], b[n+1];
    F(i, 0, n+1){
        a[i]=b[i]=0;
    }
    F(i, 0, m){
        DI(x, y);
        a[x]=1;
        b[y]=1;
    }
    x=0;
    F(i, 2, n){
        if(a[i]==0)
            x++;
        if(b[i]==0)
            x++;
    }
    if(n%2 && a[n/2+1]==0 && b[n/2+1]==0)
        x--;
    SO(x);
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
/*
#define cin fin
#define cout fout

ifstream fin("input.txt");
ofstream fout("output.txt");*/

#define SI(x) cin>>x
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define FI(w, x, y, z) cin>>w>>x>>y>>z

#define SO(x) cout<<x<<endl
#define DO(x, y) cout<<x<<" "<<y<<endl
#define TO(x, y, z) cout<<x<<" "<<y<<" "<<z<<endl
#define FO(w, x, y, z) cout<<w<<" "<<x<<" "<<y<<" "<<z<<endl

#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

#define pr pair<lli, lli>
//#define V(x) vector<x>
#define pb(x) push_back(x)
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend());
#define mp(x, y) make_pair(x, y)
#define fi first
#define se second
#define mll(x, y) map<lli x, lli y>

#define F(i, a, n) for(i=a;i<n;i++)
#define B(i, a, n) for(i=n-1;i>=a;i--)

#define mod 1000000007
#define pi 3.141592653589793238

//GCD
lli gcd(lli a, lli b){
    if(b < a)    {
        lli temp = a;
        a = b;
        b = temp;
    }
    if(a == 0){
        return b;
    }
    return gcd(b%a,a);
}
lli max(lli a, lli b){
    if(a>b)
        return a;
    return b;
}
//LCM
lli lcm(lli a, lli b){
    return (a*b/gcd(a,b));
}

//Factorial
lli fact(lli x){
    lli ans = 1;
    if(x == 0){
        return 1;
    }
    while(x > 0){
        ans = (ans*x)%mod;
        x--;
    }
    return ans%mod;
}
//C(n, r)
lli comb(lli n, lli r){
    lli x=fact(r), y=fact(n-r);
    x=(x*y)%mod;
    if(fact(n)>x)
        return fact(n)/x;
    return (fact(n)+mod)/x;
}
lli power(lli a, lli p)
{
    lli ans = 1;
    while(p > 0)
    {
        if(p%2)
        {
            ans *= a;
            ans %= 1000000007;
        }
        a*=a;
        a%=1000000007;
        p/=2;
    }
    return ans%1000000007;
}
lli dist(lli x1, lli y1, lli x2, lli y2){
    return (1.0*(x1-x2)*(x1-x2) + 1.0*(y1-y2)*(y1-y2));
}
//binary of a number
vector <lli> getbinary(lli x){
    vector <lli> bin(20000,0);
    lli iter = 0;
    while(x > 0){
        if(x%2 == 1){
            bin[iter] = 1;
        }
        else{
            bin[iter] = 0;
        }
        iter++;
        x/=2;
    }
    return bin;
}
int main(){
    lli n, m, i, j, x, y;
    DI(n, m);
    bool a[n+1][n+1];
    lli b[n+1];
    F(i, 0, n+1){
        b[i]=0;
        F(j, 0, n+1){
            a[i][j]=0;
        }
    }
    F(i, 0, m){
        DI(x, y);
        a[x][y]=1;
    }
    F(i, 1, n+1){
        F(j, 1, n+1){
            if(a[i][j]==1)
                break;
        }
        if(j==n+1){
            if(b[i]==0){
                b[i]=1;
            }
            else if(b[n+1-i]==0){
                b[n+1-i]=1;
            }
        }
    }
    F(i, 2, n){
        F(j, 1, n+1){
            if(a[j][i]==1)
                break;
        }
        if(j==n+1){
            if(b[i]==0){
                b[i]=1;
            }
            else if(b[n+1-i]==0){
                b[n+1-i]=1;
            }
        }
    }
    j=0;
    F(i, 2, n){
        if(b[i]==1)
            j++;
    }
    SO(j);
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
/*
#define cin fin
#define cout fout

ifstream fin("input.txt");
ofstream fout("output.txt");*/

#define SI(x) cin>>x
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define FI(w, x, y, z) cin>>w>>x>>y>>z

#define SO(x) cout<<x<<endl
#define DO(x, y) cout<<x<<" "<<y<<endl
#define TO(x, y, z) cout<<x<<" "<<y<<" "<<z<<endl
#define FO(w, x, y, z) cout<<w<<" "<<x<<" "<<y<<" "<<z<<endl

#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

#define pr pair<lli, lli>
//#define V(x) vector<x>
#define pb(x) push_back(x)
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend());
#define mp(x, y) make_pair(x, y)
#define fi first
#define se second
#define mll(x, y) map<lli x, lli y>

#define F(i, a, n) for(i=a;i<n;i++)
#define B(i, a, n) for(i=n-1;i>=a;i--)

#define mod 1000000007
#define pi 3.141592653589793238

//GCD
lli gcd(lli a, lli b){
    if(b < a)    {
        lli temp = a;
        a = b;
        b = temp;
    }
    if(a == 0){
        return b;
    }
    return gcd(b%a,a);
}
lli max(lli a, lli b){
    if(a>b)
        return a;
    return b;
}
//LCM
lli lcm(lli a, lli b){
    return (a*b/gcd(a,b));
}

//Factorial
lli fact(lli x){
    lli ans = 1;
    if(x == 0){
        return 1;
    }
    while(x > 0){
        ans = (ans*x)%mod;
        x--;
    }
    return ans%mod;
}
//C(n, r)
lli comb(lli n, lli r){
    lli x=fact(r), y=fact(n-r);
    x=(x*y)%mod;
    if(fact(n)>x)
        return fact(n)/x;
    return (fact(n)+mod)/x;
}
lli power(lli a, lli p)
{
    lli ans = 1;
    while(p > 0)
    {
        if(p%2)
        {
            ans *= a;
            ans %= 1000000007;
        }
        a*=a;
        a%=1000000007;
        p/=2;
    }
    return ans%1000000007;
}
lli dist(lli x1, lli y1, lli x2, lli y2){
    return (1.0*(x1-x2)*(x1-x2) + 1.0*(y1-y2)*(y1-y2));
}
//binary of a number
vector <lli> getbinary(lli x){
    vector <lli> bin(20000,0);
    lli iter = 0;
    while(x > 0){
        if(x%2 == 1){
            bin[iter] = 1;
        }
        else{
            bin[iter] = 0;
        }
        iter++;
        x/=2;
    }
    return bin;
}
int main(){
    lli n, m, i, x, y;
    DI(n, m);
    lli a[n+1], b[n+1];
    F(i, 0, n+1){
        a[i]=b[i]=0;
    }
    F(i, 0, m){
        DI(x, y);
        a[x]=1;
        b[y]=1;
    }
    x=0;
    F(i, 2, n){
        if(a[i]==0)
            x++;
        if(b[i]==0)
            x++;
    }
    if(n%2 && a[n/2+1]==0 && b[n/2+1])
        x--;
    SO(x);
}


#include<iostream>
#include<iomanip>
#include<cmath>
#include<list>
#include<climits>
#include<cstring>
#include<set>
#include<vector>
#include<map>
#include<algorithm>
#include<queue>
#include<numeric>
using namespace std;
#define etm cerr << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n'
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ull unsigned long long int
#define doub long double
#define mp make_pair
#define pb push_back
#define pii pair<int , int>
#define pdd pair<double , double>
#define pll pair<long long int,long long int>
#define vpl vector<pll >
#define vll vector<ll >
#define vi vector<int >
#define mi map<int, int>
#define mull map<ull, ull>
#define stp setprecision(20)
#define N 100005
#define rep(i,a,b,c)            for(ll i=(a);i<=(b);i+=(c))
#define repb(i,a,b,c)           for(ll i=(a);i>=(b);i-=(c))
#define MOD                     1000000007
#define ld                      long double
#define inf                     1e18
#define mp                      make_pair
#define vpll                    vector<pair<ll,ll>>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define vvll                    vector<vector<ll>>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define test                    ll T;cin>>T;while(T--)
#define isvowel(a)              (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
#define show(w,size)            for(ll i=0;i<size;i++) cout<<w[i]<<" ";
#define print(a)                cout<<a<<"\n";
#define pqll                    priority_queue<ll>
#define mset(dp,no)             memset(dp,no,sizeof(dp))
#define umll                    unordered_map<ll,ll>
#define mll                     map<ll,ll>
#define input(a,n)              ll I;rep(I,0,n-1,1) cin>>a[I];
#define countbit                __builtin_popcount // Number of set bits .
#define fbo(k)                  find_by_order // K-th element in a set (counting from zero) .
#define ook(k)                  order_of_key //  Number of items strictly smaller than k .
#define lb                      lower_bound
#define up                      upper_bound
#define in                      insert
//#define db(x) cout <<#x<<": "<<x<<'\n';
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
ll gcd(ll a,ll b){if(a<b)return gcd(b,a);else if(b==0)return a;else return gcd(b,a%b);}
ll isPrime(ll n){ll p=(ll)sqrt(n);rep(i,2,p,1) if(n%i==0) return 0;return 1;}// reuturn 1 if prime
ll pow(ll b,ll e){if(e==0)return 1;else if(e%2==0){ll a=pow(b,e/2);return a*a;}else {ll a=pow(b,e/2);return b*a*a;}}
ll powm(ll x,ll y,ll m=MOD){x=x%m;ll res=1;while(y){if(y&1)res=res*x;res%=m;y=y>>1;x=x*x;x%=m;}return res;}
ll ceil(long double a){ll b=a;if(a==b){return b;}else{return b+1;}}
ll floor(long double a){ll b=a;return b;}
ll lcm(ll a,ll b){ return (a*b)/gcd(a,b);}
ll modInverse(ll a, ll m) { return powm(a, m-2, m);}
bool issq(ll n){ ll p=sqrt(n);return p*p==n;}
vll prime;// if i==prime[i] then prime otherwise smallest prime factor of that number
void sieve(ll n)
{
    prime.resize(n+1,1);
    prime[0] = 0, prime[1] = 0;
    for (ll i = 2; i*i <= n; i++)
        if (prime[i])
            for (ll j = i * i; j <= n; j += i)
                prime[j] = 0;
}
ll extended_GCD(ll a ,ll b ,ll &x ,ll &y){
    if(a == 0){
        x = 0;
        y = 1;
        return b;
    }
    ll x1 , y1;
    ll gcd = extended_GCD(b%a , a , x1 , y1);
    x = y1 - (b/a)*x1;
    y = x1;
    return gcd;
}
    ll mulInv(ll a , ll mod=26){
    ll x , y;
    extended_GCD(a , mod , x , y);
    if(x < 0) x += mod;
    return x;
}
ll find(ll num[], ll rem[], ll k,ll prod)
{
    // Compute product of all numbers
    ll result = 0;
    // Apply above formula
    for (ll i = 0; i < k; i++)
    {
        ll pp = prod / num[i];
        result += rem[i] * mulInv(pp, num[i]) * pp;
    }
    return result % prod;
}
ll nCr(ll n,ll k)
{
  ll res = 1;

      // Since C(n, k) = C(n, n-k)
      if ( k > n - k )
          k = n - k;

      // Calculate value of
      // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
      for (ll i = 0; i < k; ++i)
      {
          res *= (n - i);
          res /= (i + 1);
      }

      return res;
}
class DSU
{
 public:vll parent,size;
public: DSU(ll n)
{

        parent.resize(n+1);size.resize(n+1);
        for(ll i=1;i<=n;i++)
            {
            parent[i]=i;
            size[i]=1;
          }
    }
public:ll find_set(ll x)
    {
      if(parent[x]==x)
      {
        return x;
      }
      return parent[x]=find_set(parent[x]);
    }
public:void union_set(ll x,ll y)
    {
        x=find_set(x);y=find_set(y);
        if(x!=y)
        {
          parent[y]=x;
        }
}
};
bool cmp(pair<ll,ll>&p1,pair<ll,ll>&p2)
{
  if(p1.fi==p2.fi)
  {
    return p1.se>p2.se;
  }
  return p1.fi>p2.fi;
}
bool isPalindrome(string s)
{
  ll i,j;
  for(i=0,j=s.length()-1;i<=j;i++,j--)
  {
    if(s[i]!=s[j])
    {
      return 0;
    }
  }
return 1;
}
ll ToInt(char ch)
{
  return ch-'0';
}
char ToChar(ll a)
{
  return a+'0';
}
bool isSubSeq(string str1, string str2, ll m, ll n)
{
    // Base Cases
    if (m == 0) return true;
    if (n == 0) return false;
    // If last characters of two strings are matching
    if (str1[m-1] == str2[n-1])
        return isSubSeq(str1, str2, m-1, n-1);
    // If last characters are not matching
    return isSubSeq(str1, str2, m, n-1);
}
void printVectorPair(vpll v)
{
  for(ll i=0;i<v.size();i++)
  {
    cout<<v[i].fi<<" "<<v[i].se<<"\n";
  }
}
void modBigNumber(string num, ll m)
{
    // Store the modulus of big number
    vector<int> vec;
    ll mod = 0;
    // Do step by step division
    for (int i = 0; i < num.size(); i++) {
        int digit = num[i] - '0';
        mod = mod * 10 + digit;
        int quo = mod / m;
        if((vec.size()!=0)||(quo!=0))        //to remove initiale zeros
        vec.push_back(quo);
        mod = mod % m;
    }
   // cout << "\nRemainder : " << mod << "\n";
   // cout << "Quotient : ";rep(i,0,vec.size()-1,1)cout<<vec[i];cout<<"\n";
    return;
}
struct SegmentTree
{
  ll n;
  vll v;
  SegmentTree(ll size)
  {
    n=4*size+1;
    v.resize(n,0);
  }
  void build(ll ar[],ll ipos,ll fpos,ll pos=1)
  {
    if(ipos>fpos)
    return ;
    if(ipos==fpos)
    v[pos]=ar[ipos];
    else
    {
    ll mid=(ipos+fpos)/2;
    build(ar,ipos,mid,pos*2);
    build(ar,mid+1,fpos,pos*2+1);
    v[pos]=v[pos*2]+v[pos*2+1];
    }
  }
  void update(ll index,ll val,ll ipos,ll fpos,ll pos=1)
  {
    if(ipos>fpos)
    return ;
    if(ipos==fpos)
    v[pos]+=val;
    else
    {
      v[pos]+=val;
      ll mid=(ipos+fpos)/2;
      if(mid>=index)
      update(index,val,ipos,mid,pos*2);
      else
      update(index,val,mid+1,fpos,pos*2+1);
    }
  }
  ll get_sum(ll l,ll r,ll ipos,ll fpos,ll pos=1)
  {
    if(ipos>fpos)
    return 0;
    if(l>r)
    return 0;
    ll mid=(ipos+fpos)/2;
    if((l==ipos)&&(r==fpos))
    return v[pos];
    else return get_sum(l,min(mid,r),ipos,mid,pos*2)+get_sum(max(mid+1,l),r,mid+1,fpos,pos*2+1);
  }
};
struct BIT
{
vector<ll>bitree;ll n;
BIT(ll n)
{
this->n=n;
bitree.resize(n+1,0);
}
void update(ll idx,ll val)
{
  idx++;
  while(idx<=n)
  {
    bitree[idx]+=val;
    idx+=idx&(-idx);
  }
}
ll Sum(ll idx)
{
  ll sum=0;
  idx++;
  while(idx>0)
  {
    sum+=bitree[idx];
    idx-=idx&(-idx);
  }
  return sum;
}
};
ll sumofdigits(ll a)
{
  ll val=0;
  while(a>0)
  {
    val+=a%10;
    a/=10;
  }
  return val;
}

int main(){
  fastio;
  ll n, m;cin>>n>>m;
  vll r(n, 0), c(n, 0);
  rep(i, 0, m-1, 1){
    ll x, y;cin>>x>>y;x--;y--;
    r[x]=1;c[y]=1;
  }
  r[0]=1;r[n-1]=1;c[0]=1;c[n-1]=1;
  ll ans=0, cnt1=0, cnt2=0;
  rep(i, 0, n-1, 1){
    if(r[i]==0){
      ans++;r[i]=2;
    }
    if(c[i]==0){
      ans++;c[i]=2;
    }
  }
  if(n&1 and (r[n/2]==2 and c[n/2]==2))ans--;
  cout<<ans<<endl;
}


#include<iostream>
#include<iomanip>
#include<cmath>
#include<list>
#include<climits>
#include<cstring>
#include<set>
#include<vector>
#include<map>
#include<algorithm>
#include<queue>
#include<numeric>
using namespace std;
#define etm cerr << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n'
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ull unsigned long long int
#define doub long double
#define mp make_pair
#define pb push_back
#define pii pair<int , int>
#define pdd pair<double , double>
#define pll pair<long long int,long long int>
#define vpl vector<pll >
#define vll vector<ll >
#define vi vector<int >
#define mi map<int, int>
#define mull map<ull, ull>
#define stp setprecision(20)
#define N 100005
#define rep(i,a,b,c)            for(ll i=(a);i<=(b);i+=(c))
#define repb(i,a,b,c)           for(ll i=(a);i>=(b);i-=(c))
#define MOD                     1000000007
#define ld                      long double
#define inf                     1e18
#define mp                      make_pair
#define vpll                    vector<pair<ll,ll>>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define vvll                    vector<vector<ll>>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define test                    ll T;cin>>T;while(T--)
#define isvowel(a)              (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
#define show(w,size)            for(ll i=0;i<size;i++) cout<<w[i]<<" ";
#define print(a)                cout<<a<<"\n";
#define pqll                    priority_queue<ll>
#define mset(dp,no)             memset(dp,no,sizeof(dp))
#define umll                    unordered_map<ll,ll>
#define mll                     map<ll,ll>
#define input(a,n)              ll I;rep(I,0,n-1,1) cin>>a[I];
#define countbit                __builtin_popcount // Number of set bits .
#define fbo(k)                  find_by_order // K-th element in a set (counting from zero) .
#define ook(k)                  order_of_key //  Number of items strictly smaller than k .
#define lb                      lower_bound
#define up                      upper_bound
#define in                      insert
//#define db(x) cout <<#x<<": "<<x<<'\n';
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
ll gcd(ll a,ll b){if(a<b)return gcd(b,a);else if(b==0)return a;else return gcd(b,a%b);}
ll isPrime(ll n){ll p=(ll)sqrt(n);rep(i,2,p,1) if(n%i==0) return 0;return 1;}// reuturn 1 if prime
ll pow(ll b,ll e){if(e==0)return 1;else if(e%2==0){ll a=pow(b,e/2);return a*a;}else {ll a=pow(b,e/2);return b*a*a;}}
ll powm(ll x,ll y,ll m=MOD){x=x%m;ll res=1;while(y){if(y&1)res=res*x;res%=m;y=y>>1;x=x*x;x%=m;}return res;}
ll ceil(long double a){ll b=a;if(a==b){return b;}else{return b+1;}}
ll floor(long double a){ll b=a;return b;}
ll lcm(ll a,ll b){ return (a*b)/gcd(a,b);}
ll modInverse(ll a, ll m) { return powm(a, m-2, m);}
bool issq(ll n){ ll p=sqrt(n);return p*p==n;}
vll prime;// if i==prime[i] then prime otherwise smallest prime factor of that number
void sieve(ll n)
{
    prime.resize(n+1,1);
    prime[0] = 0, prime[1] = 0;
    for (ll i = 2; i*i <= n; i++)
        if (prime[i])
            for (ll j = i * i; j <= n; j += i)
                prime[j] = 0;
}
ll extended_GCD(ll a ,ll b ,ll &x ,ll &y){
    if(a == 0){
        x = 0;
        y = 1;
        return b;
    }
    ll x1 , y1;
    ll gcd = extended_GCD(b%a , a , x1 , y1);
    x = y1 - (b/a)*x1;
    y = x1;
    return gcd;
}
    ll mulInv(ll a , ll mod=26){
    ll x , y;
    extended_GCD(a , mod , x , y);
    if(x < 0) x += mod;
    return x;
}
ll find(ll num[], ll rem[], ll k,ll prod)
{
    // Compute product of all numbers
    ll result = 0;
    // Apply above formula
    for (ll i = 0; i < k; i++)
    {
        ll pp = prod / num[i];
        result += rem[i] * mulInv(pp, num[i]) * pp;
    }
    return result % prod;
}
ll nCr(ll n,ll k)
{
  ll res = 1;

      // Since C(n, k) = C(n, n-k)
      if ( k > n - k )
          k = n - k;

      // Calculate value of
      // [n * (n-1) *---* (n-k+1)] / [k * (k-1) *----* 1]
      for (ll i = 0; i < k; ++i)
      {
          res *= (n - i);
          res /= (i + 1);
      }

      return res;
}
class DSU
{
 public:vll parent,size;
public: DSU(ll n)
{

        parent.resize(n+1);size.resize(n+1);
        for(ll i=1;i<=n;i++)
            {
            parent[i]=i;
            size[i]=1;
          }
    }
public:ll find_set(ll x)
    {
      if(parent[x]==x)
      {
        return x;
      }
      return parent[x]=find_set(parent[x]);
    }
public:void union_set(ll x,ll y)
    {
        x=find_set(x);y=find_set(y);
        if(x!=y)
        {
          parent[y]=x;
        }
}
};
bool cmp(pair<ll,ll>&p1,pair<ll,ll>&p2)
{
  if(p1.fi==p2.fi)
  {
    return p1.se>p2.se;
  }
  return p1.fi>p2.fi;
}
bool isPalindrome(string s)
{
  ll i,j;
  for(i=0,j=s.length()-1;i<=j;i++,j--)
  {
    if(s[i]!=s[j])
    {
      return 0;
    }
  }
return 1;
}
ll ToInt(char ch)
{
  return ch-'0';
}
char ToChar(ll a)
{
  return a+'0';
}
bool isSubSeq(string str1, string str2, ll m, ll n)
{
    // Base Cases
    if (m == 0) return true;
    if (n == 0) return false;
    // If last characters of two strings are matching
    if (str1[m-1] == str2[n-1])
        return isSubSeq(str1, str2, m-1, n-1);
    // If last characters are not matching
    return isSubSeq(str1, str2, m, n-1);
}
void printVectorPair(vpll v)
{
  for(ll i=0;i<v.size();i++)
  {
    cout<<v[i].fi<<" "<<v[i].se<<"\n";
  }
}
void modBigNumber(string num, ll m)
{
    // Store the modulus of big number
    vector<int> vec;
    ll mod = 0;
    // Do step by step division
    for (int i = 0; i < num.size(); i++) {
        int digit = num[i] - '0';
        mod = mod * 10 + digit;
        int quo = mod / m;
        if((vec.size()!=0)||(quo!=0))        //to remove initiale zeros
        vec.push_back(quo);
        mod = mod % m;
    }
   // cout << "\nRemainder : " << mod << "\n";
   // cout << "Quotient : ";rep(i,0,vec.size()-1,1)cout<<vec[i];cout<<"\n";
    return;
}
struct SegmentTree
{
  ll n;
  vll v;
  SegmentTree(ll size)
  {
    n=4*size+1;
    v.resize(n,0);
  }
  void build(ll ar[],ll ipos,ll fpos,ll pos=1)
  {
    if(ipos>fpos)
    return ;
    if(ipos==fpos)
    v[pos]=ar[ipos];
    else
    {
    ll mid=(ipos+fpos)/2;
    build(ar,ipos,mid,pos*2);
    build(ar,mid+1,fpos,pos*2+1);
    v[pos]=v[pos*2]+v[pos*2+1];
    }
  }
  void update(ll index,ll val,ll ipos,ll fpos,ll pos=1)
  {
    if(ipos>fpos)
    return ;
    if(ipos==fpos)
    v[pos]+=val;
    else
    {
      v[pos]+=val;
      ll mid=(ipos+fpos)/2;
      if(mid>=index)
      update(index,val,ipos,mid,pos*2);
      else
      update(index,val,mid+1,fpos,pos*2+1);
    }
  }
  ll get_sum(ll l,ll r,ll ipos,ll fpos,ll pos=1)
  {
    if(ipos>fpos)
    return 0;
    if(l>r)
    return 0;
    ll mid=(ipos+fpos)/2;
    if((l==ipos)&&(r==fpos))
    return v[pos];
    else return get_sum(l,min(mid,r),ipos,mid,pos*2)+get_sum(max(mid+1,l),r,mid+1,fpos,pos*2+1);
  }
};
struct BIT
{
vector<ll>bitree;ll n;
BIT(ll n)
{
this->n=n;
bitree.resize(n+1,0);
}
void update(ll idx,ll val)
{
  idx++;
  while(idx<=n)
  {
    bitree[idx]+=val;
    idx+=idx&(-idx);
  }
}
ll Sum(ll idx)
{
  ll sum=0;
  idx++;
  while(idx>0)
  {
    sum+=bitree[idx];
    idx-=idx&(-idx);
  }
  return sum;
}
};
ll sumofdigits(ll a)
{
  ll val=0;
  while(a>0)
  {
    val+=a%10;
    a/=10;
  }
  return val;
}

int main(){
  fastio;
  ll n, m;cin>>n>>m;
  vll r(n, 0), c(n, 0);
  rep(i, 0, m-1, 1){
    ll x, y;cin>>x>>y;x--;y--;
    r[x]=1;c[y]=1;
  }
  r[0]=1;r[n-1]=1;c[0]=1;c[n-1]=1;
  ll ans=0;
  rep(i, 0, n-1, 1){
    if(r[i]==0 and n%2==0){
      ans++;r[i]=1;
    }
    else if(r[i]==0){
      ans++;r[i]=1;c[i]=1;
    }
    if(c[i]==0 and n%2==0){
      ans++;c[i]=1;
    }
    else if(c[i]==0){
      ans++;r[i]=1;
    }
  }
  cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int count_val(int a[])
{
	int c=0;
	for(int i=0;i<4;i++)
		c+=a[i];

	c=4-c;

	return c;
}
int main()
{
	int n,m;
	cin>>n>>m;

	bool rows[n+1]={0};
	bool cols[n+1]={0};

	rows[1]=1;
	rows[n]=1;
	cols[1]=1;
	cols[n]=1;

	int a,b;
	for(int i=0;i<m;i++)
	{
		cin>>a>>b;
		rows[a]=1;
		cols[b]=1;
	}
	int cnt=0;
	for(int i=2;i<=n/2 ;i++ )
	{
		int arr[4]={0};
		arr[0]=rows[i];
		arr[1]=rows[n-i+1];
		arr[2]=cols[i];
		arr[3]=cols[n-i+1];
		cnt+=count_val(arr);
	}
	if(n%2)
	{
		if(rows[(n+1)/2]==0 || cols[(n+1)/2]==0)
			cnt++;
	}
	cout<<cnt<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int count_val(int a[])
{
	int c=0;
	for(int i=0;i<4;i++)
		c+=a[i];

	c=4-c;

	if(c==4 || c==3)
	{
		return 2;
	}
	else if(c==2)
	{
		return 2;
	}
	else
	{
		return c;
	}
}
int main()
{
	int n,m;
	cin>>n>>m;

	bool rows[n+1]={0};
	bool cols[n+1]={0};

	rows[1]=1;
	rows[n]=1;
	cols[1]=1;
	cols[n]=1;

	int a,b;
	for(int i=0;i<m;i++)
	{
		cin>>a>>b;
		rows[a]=1;
		cols[b]=1;
	}
	int cnt=0;
	for(int i=2;i<=n/2 ;i++ )
	{
		int arr[4]={0};
		arr[0]=rows[i];
		arr[1]=rows[n-i+1];
		arr[2]=cols[i];
		arr[3]=cols[n-i+1];
		cnt+=count_val(arr);
	}
	if(n%2)
	{
		if(rows[(n+1)/2]==0 || cols[(n+1)/2]==0)
			cnt++;
	}
	cout<<cnt<<endl;
	return 0;
}


#include <bits/stdc++.h>
 using namespace  std;
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
const double pi=3.1415926535897932384626433832;
const long long mod=1e9+7;
//long long primeset[5000000]={};
typedef complex<double> cd;
typedef long long ll;
typedef double ld;
//#define For(i,0,n) for(long long i = 0 ; i<n ;i++)
cd fast_exp(cd a, long long b)
{
	if (b == 0)
		return 1;

	cd res = fast_exp(a, b / 2);

	res = res * res;

	if (b % 2 == 1)
		res = res * a;

	return res;
}

long long fastexpon(long long a,long long b,long long mod)
{
	if(b==0)
		return 1;

	long long res=fastexpon(a,b/2,mod);

	res=(res*res)%mod;
	if(b%2==1)
		res= (res * a)%mod;

	return res;
}

//TEMPLATE ENDS HERE!!!! ------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------------------------------

struct custom
{
	bool operator()(ll a, ll b)
	{
		return a > b;
	}
};
const int N=1e5;
std::vector<pair<int,int>> edge[N+1];
int summation(int x, int par)
{
	int sum=1;
	if(edge[x].size() == 1 && edge[x][0].ff==par)
		return 1;
	else
	{

		for(auto e: edge[x])
		{
			if(e.ff!=par)
				sum+=summation(e.ff,x);
		}
	}

	return sum;
}
vector <int> saves;
void solve(int x,int par)
{
	if(edge[x].size()==1 && edge[x][0].ff==par)
		return;
	for(auto e : edge[x] )
	{
		if(e.ff!=par)
		{
			if(e.ss == 1)
				saves.pb(summation(e.ff,x));
			else
				solve(e.ff,x);
		}
	}

	return;
}

int main()
 {

	// ios_base::sync_with_stdio(false);
	// cin.tie(NULL);
	// cout.tie(NULL);
 	int n,k;
 	cin>>n>>k;

 	int a,b,r;
 	for(int i=0 ;i<n-1 ;i++)
 	{
 		cin>>a>>b>>r;
 		edge[a].pb(mp(b,r));
 		edge[b].pb(mp(a,r));
 	}
 	if(n==k)
 	{
 		cout<<0<<'\n';
 		return 0;
 	}
 	solve(1,-1);

 	sort(saves.begin(),saves.end());

 	int cum=0;
 	int check=0;
 	int ans;
 	for(int i=0 ;i<saves.size() ;i++)
 	{
 		cum+=saves[saves.size()-1-i];
 		if(cum>= n-k)
 		{
 			ans=i+1;
 			check=1;
 			break;

 		}
 	}

 	if(check==1)
 		cout<<ans<<'\n';
 	else
 		cout<<-1<<'\n';

	//cout<<'\n'<<"time elapsed: "<<clock()*1000.0 / CLOCKS_PER_SEC<<" ms"<<'\n';
	return 0;
}


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>

#define speedio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define pretime float(clock()-clk)/CLOCKS_PER_SEC
#define max2(a,b) ((a)>(b) ? (a) : (b))
#define min2(a,b) ((a)<(b) ? (a) : (b))
#define rep(i,a,b) for(i=a;i<=b;++i)
#define rev(i,a,b) for(i=a;i>=b;--i)
#define lli long long int
#define vll vector<lli>
#define vi vector<int>
#define sll set<lli>
#define si set<int>
#define pll pair<lli,lli>
#define pii pair<int,int>
#define ins insert
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define PI 3.14159265
#define mod 1000000007
clock_t clk=clock();

using namespace std;
int i,j;
void solve(void);

int main()
{
  speedio;
   int t=1;
  // cin>>t;
   while(t--)
     solve();

  return 0;
}
//
void solve()
{
	int n,m; cin>>n>>m;
	int r[n+1]={0},c[n+1]={0};
	  while(m--)
	  {
	  	int x,y; cin>>x>>y;
        r[x]=-1; c[y]=-1;
	  }

  int ct=0; bool val=0;
    rep(i,2,n-1)
      if(r[i]!=-1) ++ct;
      else
      	 {
      	 	r[i]=val; val=1-val;
      	 }

    rep(j,2,n-1)
     if(c[j]!=-1)
     {
        if((r[j]==1 && r[n+1-j]==0) || (r[n+1-j]==1 && r[j]==0))
        	++ct;
     }

     cout<<"\n"<<ct;
}


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>

#define speedio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define pretime float(clock()-clk)/CLOCKS_PER_SEC
#define max2(a,b) ((a)>(b) ? (a) : (b))
#define min2(a,b) ((a)<(b) ? (a) : (b))
#define rep(i,a,b) for(i=a;i<=b;++i)
#define rev(i,a,b) for(i=a;i>=b;--i)
#define lli long long int
#define vll vector<lli>
#define vi vector<int>
#define sll set<lli>
#define si set<int>
#define pll pair<lli,lli>
#define pii pair<int,int>
#define ins insert
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define PI 3.14159265
#define mod 1000000007
clock_t clk=clock();

using namespace std;
int i,j;
void solve(void);

int main()
{
  speedio;
   int t=1;
  // cin>>t;
   while(t--)
     solve();

  return 0;
}
//
void solve()
{
	int n,m; cin>>n>>m;
	int r[n+1]={0},c[n+1]={0};
	  while(m--)
	  {
	  	int x,y; cin>>x>>y;
        r[x]=-1; c[y]=-1;
	  }

  int ct=0; bool val=0;
    rep(i,2,n/2)
      if(r[i]!=-1)
       {
      	++ct;
      	r[i]=0;
       }
    rep(i,n/2+1,n-1)
      if(r[i]!=-1)
      {
      	++ct;
      	r[i]=1;
      }

    rep(j,2,n-1)
     if(c[j]!=-1)
     {
        if((r[j]!=0 && r[n+1-j]!=1) || (r[n+1-j]!=0 && r[j]!=1))
        	++ct;
     }

     cout<<"\n"<<ct;
}