#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+1)
      if(r[i]!=-1)
       {
      	++ct;
      	r[i]=0;
       }
    rep(i,n/2,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;
}


#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;
      	r[i]=val; val=1-val;
       }

    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;
}


#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;
}


#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
#define mem(a,b) memset((a),(b),sizeof (a))
#define rep(n) for(int i=0;i<n;i++)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define INF (long long)1e10
#define MOD 1000000007
#define MAXM 100001
void solve(){
	int n,m;
	cin>>n>>m;
	int x,y,count=0;
	int row[n],col[n],rowr[n],colr[n];
	for(int i=0;i<n;i++){
	    row[i]=col[i]=rowr[i]=colr[i]=1;
	}
	row[0]=row[n-1]=0;
	col[0]=col[n-1]=0;
	rowr[0]=rowr[n-1]=0;
	colr[0]=colr[n-1]=0;

	for(int i=0;i<m;i++){
	    cin>>x>>y;
	    x--;y--;
	    row[x]=0,col[y]=0;
	    rowr[x]=0,colr[y]=0;
	}
	for(int i=0;i<n;i++){
	    if(row[i]==1){
	        count++;
	        rowr[i]=0;
	        col[i]=0;
	        colr[n-1-i]=0;
	    }
	}
	for(int i=0;i<n;i++){
	    if(colr[i]==1){
	        count++;
	        col[i]=0;
	        rowr[i]=0;
	    }
	}
    for(int i=0;i<n;i++){
	    if(rowr[i]==1){
	        count++;
	        col[n-1-i]=0;
	    }
	}
    for(int i=0;i<n;i++){
	    if(col[i]==1){
	        count++;
	    }
	}
	cout<<count<<endl;

}

int32_t main(){
    int t=1;
    //cin>>t;
    while(t--)
        solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
#define mem(a,b) memset((a),(b),sizeof (a))
#define rep(n) for(int i=0;i<n;i++)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define INF (long long)1e10
#define MOD 1000000007
#define MAXM 100001
void solve(){
	int n,m;
	cin>>n>>m;
	int x,y,count=0;
	int row[n],col[n];
	for(int i=0;i<n;i++){
	    row[i]=col[i]=1;
	}
	for(int i=0;i<m;i++){
	    cin>>x>>y;
	    x--;y--;
	    row[x]=0,col[y]=0;
	}
	for(int i=1;i<n/2;i++){
	    if(row[i]) count++;
	    if(row[n-1-i]) count++;
	    if(col[i]) count++;
	    if(col[n-i-1]) count++;
	}
	if(n%2){
    	if(row[n/2]) count++;
    	else if (col[n/2]) count++;
	}

	cout<<count<<endl;

}

int32_t main(){
    int t=1;
    //cin>>t;
    while(t--)
        solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mod = 1e9 + 7;
const int N = 1e3 + 5;
const double PI = acos(-1);

//int mat[N][N];
int main()
{
    int n, m;
    scanf("%d%d", &n, &m);
    bool banr[N] = {0}, banc[N] = {0};
    for (int i = 0; i < m; i++) {
        int x, y;
        scanf("%d%d", &x, &y);
        banr[x - 1] = 1;
        banc[x - 1] = 1;
    }
    int cntr = 0;
    for (int i = 1; i + 1 < n; i += 2) {
        if (!banc[i]) cntr++; //mat[0][i] = 1;
    }
    for (int i = 2; i + 1 < n; i+= 2) {
        if (!banr[i]) cntr++; //mat[i][0] = 1;
    }
    printf("%d\n", cntr);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mod = 1e9 + 7;
const int N = 1e3 + 5;
const double PI = acos(-1);

//int mat[N][N];
int main()
{
    int n, m;
    scanf("%d%d", &n, &m);
    bool banr[N] = {0}, banc[N] = {0};
    for (int i = 0; i < m; i++) {
        int x, y;
        scanf("%d%d", &x, &y);
        banr[x - 1] = 1;
        banc[y - 1] = 1;
    }
    int cntr = (n - 2) * 2;
    if (n % 2) cntr--;
    for (int i = 1; i + 1 < n; i++) {
        if (banc[i]) cntr--;
        if (banr[i]) {
            if (n % 2) {
                int num = n / 2;
                if (i != num) cntr--;
            }
            else cntr--;
        }
    }
    printf("%d\n", cntr);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mod = 1e9 + 7;
const int N = 1e3 + 5;
const double PI = acos(-1);

int mat[N][N];
int main()
{
    int n, m;
    scanf("%d%d", &n, &m);
    bool banr[N] = {0}, banc[N] = {0};
    for (int i = 0; i < m; i++) {
        int x, y;
        scanf("%d%d", &x, &y);
        banr[x - 1] = 1;
        banc[y - 1] = 1;
    }
    int cntr1 = (n - 2) * 2;
    if (n % 2) cntr1--;
    int cntr2 = cntr1;
    for (int i = 1; i + 1 < n; i++) {
        if (banc[i]) cntr1--;
        if (banr[i]) {
            if (n % 2) {
                int num = n / 2;
                if (i != num) cntr1--;
            }
            else cntr1--;
        }
    }
    for (int i = 1; i + 1 < n; i++) {
        if (banr[i]) cntr2--;
        if (banc[i]) {
            if (n % 2) {
                int num = n / 2;
                if (i != num) cntr2--;
            }
            else cntr2--;
        }
    }
    printf("%d\n", max(cntr1, cntr2));
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<bits/stdc++.h>
#include<stack>
#include<queue>
#include<list>
#include<vector>
#include<bitset>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define fio ios_base::sync_with_stdio(false)
#define mod 1000000007
#define mod1 mod
#define mod2 100000009
#define li long long int
#define ll long long int
#define readi(x) scanf("%d",&x)
#define  reads(x)  scanf("%s", x)
#define readl(x) scanf("%I64d",&x)
#define rep(i,n) for(i=0;i<n;i++)
#define revp(i,n) for(i=(n-1);i>=0;i--)
#define myrep1(i,a,b) for(i=a;i<=b;i++)
#define myrep2(i,a,b) for(i=b;i>=a;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define MAXN 20000000000000000
#define MINN -10000000000000
#define pii pair<ll,ll>
#define pic pair<int,char>
#define N 4000
#define lgn 20
#define ddouble long double
#define minus minu
using namespace std;
using namespace __gnu_pbds;
typedef priority_queue<ll, vector<ll> > max_pq;
typedef priority_queue<pair<ll,pii> , vector<pair<ll,pii> > ,greater<pair<ll,pii> > > min_pq;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> OST;
ll n,m;
ll markr[N],markc[N];
ll r,g,ans;
pii ar[10];
int main()
{
    ios::sync_with_stdio(false);
    cin>>n>>m;
    for(ll i=0;i<m;i++)
    {
        ll a,b;
        cin>>a>>b;
        markr[a]=1;
        markc[b]=1;
    }
    vector<pii> vec;
    ll fans=0;
    for(ll i=2;i<=(n)/2;i++)
    {
        ar[1]=mp(i,1);
        ar[2]=mp(1,i);
        ar[3]=mp(1,n+i-1);
        ar[4]=mp(i,n);
        ar[5]=mp(n+1-i,n);
        ar[6]=mp(n,n+1-i);
        ar[7]=mp(n,i);
        ar[8]=mp(n+1-i,1);
        ll ans=0,val=0;
        for(ll j=1;j<=8;j+=2)
        {
            if((!markr[ar[j].fi])&&(!markc[ar[j].sec]))
                val++;

        }
        ans=max(ans,val);
        val=0;
        for(ll j=2;j<=8;j+=2)
        {
            if((!markr[ar[j].fi])&&(!markc[ar[j].sec]))
                val++;
        }
        fans+=ans;

    }
    //evaluate for middle row
    if((n%2))
    {
        if((!markr[(n+1)/2])||(!markc[(n+1)/2]))
        {
            fans++;
        }

    }
    cout<<fans;

}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<bits/stdc++.h>
#include<stack>
#include<queue>
#include<list>
#include<vector>
#include<bitset>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define fio ios_base::sync_with_stdio(false)
#define mod 1000000007
#define mod1 mod
#define mod2 100000009
#define li long long int
#define ll long long int
#define readi(x) scanf("%d",&x)
#define  reads(x)  scanf("%s", x)
#define readl(x) scanf("%I64d",&x)
#define rep(i,n) for(i=0;i<n;i++)
#define revp(i,n) for(i=(n-1);i>=0;i--)
#define myrep1(i,a,b) for(i=a;i<=b;i++)
#define myrep2(i,a,b) for(i=b;i>=a;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define MAXN 20000000000000000
#define MINN -10000000000000
#define pii pair<ll,ll>
#define pic pair<int,char>
#define N 4000
#define lgn 20
#define ddouble long double
#define minus minu
using namespace std;
using namespace __gnu_pbds;
typedef priority_queue<ll, vector<ll> > max_pq;
typedef priority_queue<pair<ll,pii> , vector<pair<ll,pii> > ,greater<pair<ll,pii> > > min_pq;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> OST;
ll n,m;
ll markr[N],markc[N];
ll r,g,ans;
pii ar[10];
map<pii,bool> mark;
int main()
{
    ios::sync_with_stdio(false);
    cin>>n>>m;
    for(ll i=0;i<m;i++)
    {
        ll a,b;
        cin>>a>>b;
        if(a>=2&&a<=(n-1))
            markr[a]=1;
        else
            mark[mp(a,b)]=1;
        if(b>=2&&(b<=n-1))
            markc[b]=1;
        else
            mark[mp(a,b)]=1;

    }
    vector<pii> vec;
    ll fans=0;
    for(ll i=2;i<=(n)/2;i++)
    {
        ar[1]=mp(i,1);
        ar[2]=mp(1,i);
        ar[3]=mp(1,n+i-1);
        ar[4]=mp(i,n);
        ar[5]=mp(n+1-i,n);
        ar[6]=mp(n,n+1-i);
        ar[7]=mp(n,i);
        ar[8]=mp(n+1-i,1);
        ll ans=0,val=0;
        for(ll j=1;j<=8;j+=2)
        {
            if((!markr[ar[j].fi])&&(!markc[ar[j].sec])&&(!mark[ar[i]]))
                val++;

        }
        ans=max(ans,val);
        val=0;
        for(ll j=2;j<=8;j+=2)
        {
            if((!markr[ar[j].fi])&&(!markc[ar[j].sec])&&(!mark[ar[i]]))
                val++;
        }
        fans+=ans;

    }
    //evaluate for middle row
    if((n%2))
    {
        if((!markr[(n+1)/2])||(!markc[(n+1)/2]))
        {
            fans++;
        }

    }
    cout<<fans;

}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<bits/stdc++.h>
#include<stack>
#include<queue>
#include<list>
#include<vector>
#include<bitset>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define fio ios_base::sync_with_stdio(false)
#define mod 1000000007
#define mod1 mod
#define mod2 100000009
#define li long long int
#define ll long long int
#define readi(x) scanf("%d",&x)
#define  reads(x)  scanf("%s", x)
#define readl(x) scanf("%I64d",&x)
#define rep(i,n) for(i=0;i<n;i++)
#define revp(i,n) for(i=(n-1);i>=0;i--)
#define myrep1(i,a,b) for(i=a;i<=b;i++)
#define myrep2(i,a,b) for(i=b;i>=a;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define MAXN 20000000000000000
#define MINN -10000000000000
#define pii pair<ll,ll>
#define pic pair<int,char>
#define N 4000
#define lgn 20
#define ddouble long double
#define minus minu
using namespace std;
using namespace __gnu_pbds;
typedef priority_queue<ll, vector<ll> > max_pq;
typedef priority_queue<pair<ll,pii> , vector<pair<ll,pii> > ,greater<pair<ll,pii> > > min_pq;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> OST;
ll n,m;
ll markr[N],markc[N];
ll r,g,ans;
pii ar[10];
map<pii,bool> mark;
int main()
{
    ios::sync_with_stdio(false);
    cin>>n>>m;
    for(ll i=0;i<m;i++)
    {
        ll a,b;
        cin>>a>>b;
        if(a>=2&&a<=(n-1))
            markr[a]=1;
        else
            mark[mp(a,b)]=1;
        if(b>=2&&(b<=n-1))
            markc[b]=1;
        else
            mark[mp(a,b)]=1;

    }
    vector<pii> vec;
    ll fans=0;
    for(ll i=2;i<=(n)/2;i++)
    {
        ar[1]=mp(i,1);
        ar[2]=mp(1,i);
        ar[3]=mp(1,n-i+1);
        ar[4]=mp(i,n);
        ar[5]=mp(n+1-i,n);
        ar[6]=mp(n,n+1-i);
        ar[7]=mp(n,i);
        ar[8]=mp(n+1-i,1);
        ll ans=0,val=0;
        for(ll j=1;j<=8;j+=2)
        {
            if((!markr[ar[j].fi])&&(!markc[ar[j].sec])&&(!mark[ar[j]]))
                val++;

        }
        ans=max(ans,val);
        val=0;
        for(ll j=2;j<=8;j+=2)
        {
            if((!markr[ar[j].fi])&&(!markc[ar[j].sec])&&(!mark[ar[j]]))
                val++;
        }
        fans+=ans;

    }
    //evaluate for middle row
    if((n%2))
    {
        if((!markr[(n+1)/2])||(!markc[(n+1)/2]))
        {
            fans++;
        }

    }
    cout<<fans;

}


#include<bits/stdc++.h>
#include<set>
#define ll long long int
#define pb push_back
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    int h[n]={0};
    int v[n]={0};
    int hh,vv;
    for(int i=0;i<m;i++)
    {
        cin>>hh;
        cin>>vv;
        h[hh]=-1;
        v[vv]=-1;
    }
    if(n==2)
        cout<<"0";
    else if(m==0 && n%2==0)
        cout<<2*(n-2);
    else if(m==0 && n%2!=0)
        cout<<2*(n-2)-1;
    else
    {
        int cnt=0;
        for(int i=2;i<n;i++)
        {
            if(h[i]==0)
                cnt++;
        }
        for(int i=2;i<n;i++)
        {
            if(v[i]==0)
                cnt++;
        }
        cout<<cnt;
    }
    return 0;
}


#include<bits/stdc++.h>
#include<set>
#define ll long long int
#define pb push_back
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    int h[n]={0};
    int v[n]={0};
    int hh,vv;
    for(int i=0;i<m;i++)
    {
        cin>>hh;
        cin>>vv;
        h[hh]=-1;
        v[vv]=-1;
    }
    if(n==2)
        cout<<"0";
    else if(m==0 && n>=3)
        cout<<n-2;
    else
    {
        int cnt=0;
        for(int i=2;i<n;i++)
        {
            if(h[i]==0)
                cnt++;
        }
        for(int i=2;i<n;i++)
        {
            if(v[i]==0)
                cnt++;
        }
        cout<<cnt;
    }
    return 0;
}


#include<bits/stdc++.h>
#include<set>
#define ll long long int
#define pb push_back
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    int h[n]={0};
    int v[n]={0};
    int hh,vv;
    for(int i=0;i<m;i++)
    {
        cin>>hh;
        cin>>vv;
        h[hh]=-1;
        v[vv]=-1;
    }
    if(n==2)
        cout<<"0";
    if(m==0 && n>=3)
        cout<<n-2;
    else
    {
        int cnt=0;
        for(int i=2;i<n;i++)
        {
            if(h[i]==0)
                cnt++;
        }
        for(int i=2;i<n;i++)
        {
            if(v[i]==0)
                cnt++;
        }
        cout<<cnt;
    }
    return 0;
}


#include <bits/stdc++.h>
#define for0(i, n) for(int i = 0; i < n; i++)
#define for1(i, n) for(int i = 1; i <= n; i++)
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define V vector<int>
#define VP vector<pair<int, int> >
#define FASTIO ios_base::sync_with_stdio(0); cin.tie(0)
using namespace std;
#ifdef _WIN32
#include <windows.h>
#define print(x) PRINT(x, #x)
template<typename T> inline const void PRINT(T VARIABLE, string NAME)
{
#ifndef ONLINE_JUDGE /// ONLINE_JUDGE IS DEFINED ON CODEFORCES
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(hConsole, 10);
    cerr << NAME << " = " << VARIABLE << '\n';
    SetConsoleTextAttribute(hConsole, 7);
#endif
}
#else
#define print(x) 0
#endif
struct pair_hash
{
    template<typename T1, typename T2>
    size_t operator () (const pair<T1, T2> &p) const
    {
        auto h1 = hash<T1> {}(p.first);
        auto h2 = hash<T2> {}(p.second);
        return h1 ^ h2;
    }
};
typedef long long ll;
typedef unsigned long long ull;
const ll INFLL = 2 * (ll)1e18 + 100;
const int INFINT = 2 * (int)1e9 + 100;
//ifstream fin(".in");
//ofstream fout(".out");
void die()
{
    cout << "NO";
    exit(0);
}
const int NMAX = 1e3 + 5;
const int MOD = 1e9 + 7; /// careful here (7 or 9, 66.. etc)
const double PI = atan(1) * 4;
const double EPS = 1e-12;

int n, m;
int mat[NMAX][NMAX];
int sol;

int main()
{
    FASTIO;
    cin >> n >> m;
    for1(i, m)
    {
        int a, b;
        cin >> a >> b;
        mat[a][b] = 1;
        mat[1][b] = 1;
        mat[a][1] = 1;
        mat[n][b] = 1;
        mat[a][n] = 1;
    }
    mat[1][1] = mat[1][n] = mat[n][1] = mat[n][n] = 1;

    for1(i, n) if(!mat[1][i])
    {
        sol++;
        mat[1][i] = 2;
    }
    for1(i, n) if(!mat[i][1])
    {
        if(mat[1][i] == 2 && n % 2 == 1 && i == n / 2 + 1) continue;
        sol++;
    }

    cout << sol;

    return 0;
}


#include <bits/stdc++.h>
#define for0(i, n) for(int i = 0; i < n; i++)
#define for1(i, n) for(int i = 1; i <= n; i++)
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define V vector<int>
#define VP vector<pair<int, int> >
#define FASTIO ios_base::sync_with_stdio(0); cin.tie(0)
using namespace std;
#ifdef _WIN32
#include <windows.h>
#define print(x) PRINT(x, #x)
template<typename T> inline const void PRINT(T VARIABLE, string NAME)
{
#ifndef ONLINE_JUDGE /// ONLINE_JUDGE IS DEFINED ON CODEFORCES
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(hConsole, 10);
    cerr << NAME << " = " << VARIABLE << '\n';
    SetConsoleTextAttribute(hConsole, 7);
#endif
}
#else
#define print(x) 0
#endif
struct pair_hash
{
    template<typename T1, typename T2>
    size_t operator () (const pair<T1, T2> &p) const
    {
        auto h1 = hash<T1> {}(p.first);
        auto h2 = hash<T2> {}(p.second);
        return h1 ^ h2;
    }
};
typedef long long ll;
typedef unsigned long long ull;
const ll INFLL = 2 * (ll)1e18 + 100;
const int INFINT = 2 * (int)1e9 + 100;
//ifstream fin(".in");
//ofstream fout(".out");
void die()
{
    cout << "NO";
    exit(0);
}
const int NMAX = 1e3 + 5;
const int MOD = 1e9 + 7; /// careful here (7 or 9, 66.. etc)
const double PI = atan(1) * 4;
const double EPS = 1e-12;

int n, m;
bool mat[NMAX][NMAX];
int sol;

int main()
{
    FASTIO;
    cin >> n >> m;
    for1(i, m)
    {
        int a, b;
        cin >> a >> b;
        mat[a][b] = 1;
        mat[1][b] = 1;
        mat[a][1] = 1;
        mat[n][b] = 1;
        mat[a][n] = 1;
    }
    mat[1][1] = mat[1][n] = mat[n][1] = mat[n][n] = 1;

    for1(i, n) if(!mat[1][i])
    {
        sol++;
        if(mat[i][1]) continue;
        else if(mat[i][n]) continue;

        mat[i][1] = 1;
    }
    for1(i, n) if(!mat[i][1] || !mat[i][n]) sol++;

    cout << sol;

    return 0;
}


#include <bits/stdc++.h>
#define for0(i, n) for(int i = 0; i < n; i++)
#define for1(i, n) for(int i = 1; i <= n; i++)
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define V vector<int>
#define VP vector<pair<int, int> >
#define FASTIO ios_base::sync_with_stdio(0); cin.tie(0)
using namespace std;
#ifdef _WIN32
#include <windows.h>
#define print(x) PRINT(x, #x)
template<typename T> inline const void PRINT(T VARIABLE, string NAME)
{
#ifndef ONLINE_JUDGE /// ONLINE_JUDGE IS DEFINED ON CODEFORCES
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(hConsole, 10);
    cerr << NAME << " = " << VARIABLE << '\n';
    SetConsoleTextAttribute(hConsole, 7);
#endif
}
#else
#define print(x) 0
#endif
struct pair_hash
{
    template<typename T1, typename T2>
    size_t operator () (const pair<T1, T2> &p) const
    {
        auto h1 = hash<T1> {}(p.first);
        auto h2 = hash<T2> {}(p.second);
        return h1 ^ h2;
    }
};
typedef long long ll;
typedef unsigned long long ull;
const ll INFLL = 2 * (ll)1e18 + 100;
const int INFINT = 2 * (int)1e9 + 100;
//ifstream fin(".in");
//ofstream fout(".out");
void die()
{
    cout << "NO";
    exit(0);
}
const int NMAX = 1e3 + 5;
const int MOD = 1e9 + 7; /// careful here (7 or 9, 66.. etc)
const double PI = atan(1) * 4;
const double EPS = 1e-12;

int n, m;
bool mat[NMAX][NMAX];
int sol;

int main()
{
    FASTIO;
    cin >> n >> m;
    for1(i, m)
    {
        int a, b;
        cin >> a >> b;
        mat[a][b] = 1;
        mat[1][b] = 1;
        mat[a][1] = 1;
    }
    mat[1][1] = mat[1][n] = mat[n][1] = mat[n][n] = 1;

    for1(i, n) if(!mat[1][i])
    {
        mat[i][1] = 1;
        mat[1][i] = 1;
        sol++;
    }

    for1(i, n) if(!mat[i][1])
        sol++;
   cout << sol;

    return 0;
}


#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define f(i, n) for(int i = 0; i < n; ++i)
#define pb push_back
#define T int t = 0; cin >> t; while(t--)
#define b_e(a) a.begin(), a.end()
typedef long long ll;
typedef long double lld;
const ll mod = 1e9 + 7;
const ll mx = 5e5 + 5;
const ll inf = 1e18;

void input(){
    IOS;
    int n, m;
    cin >> n >> m;
    set<int>row, col;
    for(int i = 2; i < n; ++i)row.insert(i), col.insert(i);
    f(i, n){
        int x, y;
        cin >> x >> y;
        if(row.find(x) != row.end())row.erase(x);
        if(col.find(y) != col.end())col.erase(y);
    }
    int ans = 0;
    if(n & 1){
        if(row.find((n + 1) / 2) != row.end() || col.find((n + 1) / 2) !=  col.end()){
            ++ans;
        }
    }
    ++n;
    for(int i = 2; i <= (n - 1) / 2; ++i){
        if(row.find(i) != row.end()){
            ++ans;
            row.erase(row.find(i));
        }
        if(row.find(n - i) != row.end()){
            ++ans;
            row.erase(row.find(n - i));
        }
        if(col.find(i) != col.end()){
            ++ans;
            col.erase(col.find(i));
        }
        if(col.find(n - i) != col.end()){
            ++ans;
            col.erase(col.find(n - i));
        }
    }
    cout << ans << endl;
}
int main(){
    input();
    return 0;
}


#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define f(i, n) for(int i = 0; i < n; ++i)
#define pb push_back
#define T int t = 0; cin >> t; while(t--)
#define b_e(a) a.begin(), a.end()
typedef long long ll;
typedef long double lld;
const ll mod = 1e9 + 7;
const ll mx = 5e5 + 5;
const ll inf = 1e18;

void input(){
    IOS;
    int n, m;
    cin >> n >> m;
    set<int>row, col;
    for(int i = 2; i < n; ++i)row.insert(i), col.insert(i);
    f(i, n){
        int x, y;
        cin >> x >> y;
        if(row.find(x) != row.end())row.erase(x);
        if(col.find(y) != col.end())col.erase(y);
    }
    int ans = 0;
    if(n & 1){
        if(row.find((n + 1) / 2) != row.end() || col.find((n + 1) / 2) !=  col.end()){
            ++ans;
        }
    }
    for(int i = 2; i <= n / 2; ++i){
        if(row.find(i) != row.end()){
            ++ans;
            row.erase(row.find(i));
        }
        if(row.find(n - i) != row.end()){
            ++ans;
            row.erase(row.find(n - i));
        }
        if(col.find(i) != col.end()){
            ++ans;
            col.erase(col.find(i));
        }
        if(col.find(n - i) != col.end()){
            ++ans;
            col.erase(col.find(n - 1));
        }
    }
    cout << ans << endl;
}
int main(){
    input();
    return 0;
}


#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define f(i, n) for(int i = 0; i < n; ++i)
#define pb push_back
#define T int t = 0; cin >> t; while(t--)
#define b_e(a) a.begin(), a.end()
typedef long long ll;
typedef long double lld;
const ll mod = 1e9 + 7;
const ll mx = 5e5 + 5;
const ll inf = 1e18;

void input(){
    IOS;
    int n, m;
    cin >> n >> m;
    set<int>row, col;
    for(int i = 2; i < n; ++i)row.insert(i), col.insert(i);
    f(i, n){
        int x, y;
        cin >> x >> y;
        if(row.find(x) != row.end())row.erase(x);
        if(col.find(y) != col.end())col.erase(y);
    }
    int ans = 0;
    if(n & 1){
        if(row.find((n + 1) / 2) != row.end() || col.find((n + 1) / 2) !=  col.end()){
            ++ans;
        }
    }
    ++n;
    for(int i = 2; i <= (n - 1) / 2; ++i){
        if(row.find(i) != row.end()){
            ++ans;
            row.erase(row.find(i));
        }
        if(row.find(n - i) != row.end()){
            ++ans;
            row.erase(row.find(n - i));
        }
        if(col.find(i) != col.end()){
            ++ans;
            col.erase(col.find(i));
        }
        if(col.find(n - i) != col.end()){
            ++ans;
            col.erase(col.find(n - 1));
        }
    }
    cout << ans << endl;
}
int main(){
    input();
    return 0;
}


#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define f(i, n) for(int i = 0; i < n; ++i)
#define pb push_back
#define T int t = 0; cin >> t; while(t--)
#define b_e(a) a.begin(), a.end()
typedef long long ll;
typedef long double lld;
const ll mod = 1e9 + 7;
const ll mx = 5e5 + 5;
const ll inf = 1e18;

void input(){
    IOS;
    int n, m;
    cin >> n >> m;
    set<int>row, col;
    for(int i = 2; i < n; ++i)row.insert(i), col.insert(i);
    f(i, n){
        int x, y;
        cin >> x >> y;
        if(row.find(x) != row.end())row.erase(x);
        if(col.find(y) != col.end())col.erase(y);
    }
    int ans = 0;
    if((int)row.size() == 0 && (int)col.size() == 0){cout << 0 << endl;return;}
    if(n & 1){
        if(row.find((n + 1) / 2) != row.end() || col.find((n + 1) / 2) !=  col.end()){
            ++ans;
        }
        if(row.find((n + 1) / 2) != row.end())row.erase(row.find((n + 1) / 2));
        if(col.find((n + 1) / 2) != col.end())col.erase(col.find((n + 1) / 2));
    }
    ans += (int)row.size() + (int)col.size();
    cout << ans << endl;
}
int main(){
    input();
    return 0;
}


#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define f(i, n) for(int i = 0; i < n; ++i)
#define pb push_back
#define T int t = 0; cin >> t; while(t--)
#define b_e(a) a.begin(), a.end()
typedef long long ll;
typedef long double lld;
const ll mod = 1e9 + 7;
const ll mx = 5e5 + 5;
const ll inf = 1e18;

void input(){
    IOS;
    int n, m;
    cin >> n >> m;
    set<int>row, col;
    for(int i = 2; i < n; ++i)row.insert(i), col.insert(i);
    f(i, m){
        int x, y;
        cin >> x >> y;
        if(row.find(x) != row.end())row.erase(x);
        if(col.find(y) != col.end())col.erase(y);
    }
    int ans = 0;
    if((int)row.size() == 0 && (int)col.size() == 0){cout << 0 << endl;return;}
    if(n & 1){
        if(row.find((n + 1) / 2) != row.end() || col.find((n + 1) / 2) !=  col.end()){
            ++ans;
        }
        if(row.find((n + 1) / 2) != row.end())row.erase(row.find((n + 1) / 2));
        if(col.find((n + 1) / 2) != col.end())col.erase(col.find((n + 1) / 2));
    }
    ans += (int)row.size() + (int)col.size();
    cout << ans << endl;
}
int main(){
    input();
    return 0;
}


            #include <bits/stdc++.h>
            #include <ext/pb_ds/assoc_container.hpp>
            #include <ext/pb_ds/tree_policy.hpp>
            using namespace std;
            using namespace __gnu_pbds;
            #define rep(i,a,b) for(ll i =a; i<b;++i)
            #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
            #define endl "\n"
            #define pb push_back
            #define F first
            #define S second
            #define print(a)       for(auto x : a) cout << x << " "; cout << endl
            #define print1(a)      for(auto x : a) cout << x.F << " " << x.S << endl
            #define print2(a,x,y)  for(int i = x; i < y; i++) cout<< a[i]<< " "; cout << endl
            #define mk(x,y)  make_pair(x,y)
            typedef  long long int ll;
            const ll N =  1e6+ 5 ;
            const ll mod = 1e9+7 ;
            ll n ,x[N] , y[N] ,m;
    ll pow_mod_m(ll a , ll n)
    {
        if(!n)
            return 1;
        ll pt =  pow_mod_m(a,n/2);
        pt *= pt ;
        if(n&1)
            pt *= a;
        return pt;
    }

    int main()
    {
         IOS;
         int ts =1;
       ///  cin >> ts;
         rep(t,1,ts+1)
         {
            cin >> n >> m;
            set <ll > r, c;
            rep(i,0,m){
                cin >> x[i] >> y[i];
                if(x[i] >= 2 and x[i] <= n-1)
                r.insert(x[i]);
                if(y[i] >= 2 and y[i] <= n-1)
                 c.insert(y[i]);
            }
            ll ans  = n-2;
            rep(i,2,n)
            {
                if( (r.find(i) != r.end()) and (c.find(i) != c.end()) )
                {
                    ///cout << " in here\n";
                    ans--;
                }
            }
            cout << ans << endl;
         }
  }


            #include <bits/stdc++.h>
            #include <ext/pb_ds/assoc_container.hpp>
            #include <ext/pb_ds/tree_policy.hpp>
            using namespace std;
            using namespace __gnu_pbds;
            #define rep(i,a,b) for(ll i =a; i<b;++i)
            #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
            #define endl "\n"
            #define pb push_back
            #define F first
            #define S second
            #define print(a)       for(auto x : a) cout << x << " "; cout << endl
            #define print1(a)      for(auto x : a) cout << x.F << " " << x.S << endl
            #define print2(a,x,y)  for(int i = x; i < y; i++) cout<< a[i]<< " "; cout << endl
            #define mk(x,y)  make_pair(x,y)
            typedef  long long int ll;
            const ll N =  1e6+ 5 ;
            const ll mod = 1e9+7 ;
            ll n ,x[N] , y[N] ,m;
    ll pow_mod_m(ll a , ll n)
    {
        if(!n)
            return 1;
        ll pt =  pow_mod_m(a,n/2);
        pt *= pt ;
        if(n&1)
            pt *= a;
        return pt;
    }

    int main()
    {
         IOS;
         int ts =1;
       ///  cin >> ts;
         rep(t,1,ts+1)
         {
            cin >> n >> m;
            set <ll > r, c;
            rep(i,0,m){
                cin >> x[i] >> y[i];
                if(x[i] >= 2 and x[i] <= n-1)
                r.insert(x[i]);
                if(y[i] >= 2 and y[i] <= n-1)
                 c.insert(y[i]);
            }
            ll ans  =2*(n-2);
            if( n& 1) ans --;
            for(int i = 2; i <= n/2; i++)
            {
                if(r.find(i) != r.end()) ans --;
                if(r.find(n+1-i) != r.end()) ans --;
                if(c.find(i) != c.end()) ans --;
                if(c.find(n+1-i) != c.end()) ans --;
            }
            if(n & 1)
            {
                if(r.find((n+1)/2) != r.end() and c.find((n+1)/2) != c.end())
                    ans--;
            }
            cout << ans << endl;
         }
  }


            #include <bits/stdc++.h>
            #include <ext/pb_ds/assoc_container.hpp>
            #include <ext/pb_ds/tree_policy.hpp>
            using namespace std;
            using namespace __gnu_pbds;
            #define rep(i,a,b) for(ll i =a; i<b;++i)
            #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
            #define endl "\n"
            #define pb push_back
            #define F first
            #define S second
            #define print(a)       for(auto x : a) cout << x << " "; cout << endl
            #define print1(a)      for(auto x : a) cout << x.F << " " << x.S << endl
            #define print2(a,x,y)  for(int i = x; i < y; i++) cout<< a[i]<< " "; cout << endl
            #define mk(x,y)  make_pair(x,y)
            typedef  long long int ll;
            const ll N =  1e6+ 5 ;
            const ll mod = 1e9+7 ;
            ll n ,x[N] , y[N] ,m;
    ll pow_mod_m(ll a , ll n)
    {
        if(!n)
            return 1;
        ll pt =  pow_mod_m(a,n/2);
        pt *= pt ;
        if(n&1)
            pt *= a;
        return pt;
    }

    int main()
    {
         IOS;
         int ts =1;
       ///  cin >> ts;
         rep(t,1,ts+1)
         {
            cin >> n >> m;
            set <ll > r, c;
            rep(i,0,m){
                cin >> x[i] >> y[i];
                if(x[i] >= 2 and x[i] <= n-1)
                r.insert(x[i]);
                if(y[i] >= 2 and y[i] <= n-1)
                 c.insert(y[i]);
            }
            ll ans  = 2*(n-2);
            rep(i,2,n)
            {
                if( (r.find(i) != r.end()) )
                {
                    ans--;
                }
                if( (c.find(i) != c.end())  )
                {
                    ans--;
                }
            }
            if(n & 1) ans --;
            cout << ans << endl;
         }
  }


            #include <bits/stdc++.h>
            #include <ext/pb_ds/assoc_container.hpp>
            #include <ext/pb_ds/tree_policy.hpp>
            using namespace std;
            using namespace __gnu_pbds;
            #define rep(i,a,b) for(ll i =a; i<b;++i)
            #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
            #define endl "\n"
            #define pb push_back
            #define F first
            #define S second
            #define print(a)       for(auto x : a) cout << x << " "; cout << endl
            #define print1(a)      for(auto x : a) cout << x.F << " " << x.S << endl
            #define print2(a,x,y)  for(int i = x; i < y; i++) cout<< a[i]<< " "; cout << endl
            #define mk(x,y)  make_pair(x,y)
            typedef  long long int ll;
            const ll N =  1e6+ 5 ;
            const ll mod = 1e9+7 ;
            ll n ,x[N] , y[N] ,m;
    ll pow_mod_m(ll a , ll n)
    {
        if(!n)
            return 1;
        ll pt =  pow_mod_m(a,n/2);
        pt *= pt ;
        if(n&1)
            pt *= a;
        return pt;
    }

    int main()
    {
         IOS;
         int ts =1;
       ///  cin >> ts;
         rep(t,1,ts+1)
         {
            cin >> n >> m;
            set <ll > r, c;
            rep(i,0,m){
                cin >> x[i] >> y[i];
                if(x[i] >= 2 and x[i] <= n-1)
                r.insert(x[i]);
                if(y[i] >= 2 and y[i] <= n-1)
                 c.insert(y[i]);
            }
            ll ans  = 2*(n-2);
            rep(i,2,n)
            {
                if( (r.find(i) != r.end()) )
                {
                    ans--;
                }
                if( (c.find(i) != c.end())  )
                {
                    ans--;
                }
            }
            cout << ans << endl;
         }
  }


            #include <bits/stdc++.h>
            #include <ext/pb_ds/assoc_container.hpp>
            #include <ext/pb_ds/tree_policy.hpp>
            using namespace std;
            using namespace __gnu_pbds;
            #define rep(i,a,b) for(ll i =a; i<b;++i)
            #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
            #define endl "\n"
            #define pb push_back
            #define F first
            #define S second
            #define print(a)       for(auto x : a) cout << x << " "; cout << endl
            #define print1(a)      for(auto x : a) cout << x.F << " " << x.S << endl
            #define print2(a,x,y)  for(int i = x; i < y; i++) cout<< a[i]<< " "; cout << endl
            #define mk(x,y)  make_pair(x,y)
            typedef  long long int ll;
            const ll N =  1e6+ 5 ;
            const ll mod = 1e9+7 ;
            ll n ,x[N] , y[N] ,m;
    ll pow_mod_m(ll a , ll n)
    {
        if(!n)
            return 1;
        ll pt =  pow_mod_m(a,n/2);
        pt *= pt ;
        if(n&1)
            pt *= a;
        return pt;
    }

    int main()
    {
         IOS;
         int ts =1;
       ///  cin >> ts;
         rep(t,1,ts+1)
         {
            cin >> n >> m;
            set <ll > r, c;
            rep(i,0,m){
                cin >> x[i] >> y[i];
                if(x[i] >= 2 and x[i] <= n-1)
                r.insert(x[i]);
                if(y[i] >= 2 and y[i] <= n-1)
                 c.insert(y[i]);
            }
            ll ans  = 2*(n-2);
            rep(i,2,n)
            {
                if( (r.find(i) != r.end()) )
                {
                    ans--;
                }
                if( (c.find(i) != c.end())  )
                {
                    ans--;
                }
            }
            if(n & 1) ans --;
            cout << max(ans, 0ll) << endl;
         }
  }


#include<bits/stdc++.h>
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define MOD 1000000007
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define FOR(a,n) for(int i=a;i<n;++i)
#define arrin(n) for(int i=0; i < n; ++i) cin>>arr[i];
#define arrout(n) for(int i=0; i < n; ++i) cout<<arr[i]<<" ";cout<<nl;
#define nl "\n"
#define mp make_pair
typedef unsigned long long ull;
typedef long long int ll;
typedef long double ld;
using namespace std;
const double pi=acos(-1.0);
const double pii=2*pi;
const double eps=1e-6;
const double inf=1e15;
typedef pair<ll,ll>  iPair;
typedef priority_queue<iPair> Pq;
int main()
{
  fastio();
  #ifndef ONLINE_JUDGE
      freopen("input.txt","r",stdin);
      freopen("output.txt","w",stdout);
  #endif
  ll n,m;
  cin>>n>>m;
  ll a[n][n];
  memset(a,0,sizeof(a));
  ll x,y;
  for(ll i=0;i<m;i++)
  {
    cin>>x>>y;
    x--,y--;
    a[x][y]=1;
  }
  a[0][0]=1,a[0][n-1]=1,a[n-1][0]=1,a[n-1][n-1]=1;
  set<ll> ans;
  ll r[n],c[n];
  for(ll i=0;i<n;i++)
  {
    r[i]=0;
    for(ll j=0;j<n;j++)
    {
       r[i]+=a[i][j];
    }
    //cout<<r[i]<<" "<<i<<nl;
    if(r[i]==0) ans.insert(i);
  }
  for(ll i=0;i<n;i++)
  {
    c[i]=0;
    for(ll j=0;j<n;j++)
    {
       c[i]+=a[j][i];
    }
    //cout<<c[i]<<" "<<i<<nl;
    if(c[i]==0) ans.insert(n-1-i);
  }
  cout<<ans.size()<<nl;
  //std::cout <<fixed<< std::setprecision(15) <<ans<< '\n';
  cerr << "Time : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n";
  return 0;
}


#include<bits/stdc++.h>
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define MOD 1000000007
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define FOR(a,n) for(int i=a;i<n;++i)
#define arrin(n) for(int i=0; i < n; ++i) cin>>arr[i];
#define arrout(n) for(int i=0; i < n; ++i) cout<<arr[i]<<" ";cout<<nl;
#define nl "\n"
#define mp make_pair
typedef unsigned long long ull;
typedef long long int ll;
typedef long double ld;
using namespace std;
const double pi=acos(-1.0);
const double pii=2*pi;
const double eps=1e-6;
const double inf=1e15;
typedef pair<ll,ll>  iPair;
typedef priority_queue<iPair> Pq;
int main()
{
  fastio();
  #ifndef ONLINE_JUDGE
      freopen("input.txt","r",stdin);
      freopen("output.txt","w",stdout);
  #endif
  ll n,m;
  cin>>n>>m;
  ll a[n][n];
  memset(a,0,sizeof(a));
  ll x,y;
  for(ll i=0;i<m;i++)
  {
    cin>>x>>y;
    x--,y--;
    a[x][y]=1;
  }
  a[0][0]=1,a[0][n-1]=1,a[n-1][0]=1,a[n-1][n-1]=1;
  ll r[n],c[n];
  ll ans=0;
  for(ll i=0;i<n;i++)
  {
    r[i]=0;
    for(ll j=0;j<n;j++)
    {
       r[i]+=a[i][j];
    }
    //cout<<r[i]<<" "<<i<<nl;
    if(r[i]==0) ans++;
  }
  for(ll i=0;i<n;i++)
  {
    c[i]=0;
    for(ll j=0;j<n;j++)
    {
       c[i]+=a[j][i];
    }
    //cout<<c[i]<<" "<<i<<nl;
    if(c[i]==0)  ans++;
  }
  if(n%2!=0 && r[n/2]==0 && c[n/2]==0) ans--;
  cout<<ans<<nl;
  //std::cout <<fixed<< std::setprecision(15) <<ans<< '\n';
  cerr << "Time : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n";
  return 0;
}


#include<bits/stdc++.h>
using namespace std;

#ifndef strange
#define trace(...)
#define endl '\n'
#define start_routine()
#define end_routine()
#endif
typedef long long ll;
//__gcd

#define mod 1000000007
#define F first
#define S second

#define sz(x)  (long long (x.size()))

#define pb push_back
// #define int long long

//memset(dp,0x3f,sizeof(dp));

int n,m;

signed main(){
    int t=1;
    start_routine();
    cin.tie(0); cout.tie(0);
    ios_base::sync_with_stdio(NULL);

    // cin>>t;
    while(t-->0){
        cin>>n>>m;
        set<int> rows;
        set<int> cols;
        for(int i=2;i<n;i++){
            rows.insert(i);
            cols.insert(i);
        }
        int x,y;
        for(int i=0;i<m;i++){
            cin>>x>>y;
            if(rows.find(x)!=rows.end()){
                rows.erase(x);
            }
            if(cols.find(y)!=cols.end()){
                cols.erase(y);
            }
        }
        // for(auto itr=cols.begin();itr!=cols.end();itr++){
        //     cout<<*itr<<"\n";
        // }
        int ans=0;
        ans=rows.size()+cols.size();
        // cout<<ans<<"\n";

        n++;
        if(rows.find(n/2)!=rows.end() && cols.find(n/2)!=cols.end()){
            ans--;
        }
        cout<<ans;

    }

    end_routine();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#ifndef strange
#define trace(...)
#define endl '\n'
#define start_routine()
#define end_routine()
#endif
typedef long long ll;
//__gcd

#define mod 1000000007
#define F first
#define S second

#define sz(x)  (long long (x.size()))

#define pb push_back
// #define int long long

//memset(dp,0x3f,sizeof(dp));

int n,m;

signed main(){
    int t=1;
    start_routine();
    cin.tie(0); cout.tie(0);
    ios_base::sync_with_stdio(NULL);

    // cin>>t;
    while(t-->0){
        cin>>n>>m;
        set<int> rows;
        set<int> cols;
        for(int i=2;i<n;i++){
            rows.insert(i);
            cols.insert(i);
        }
        int x,y;
        for(int i=0;i<m;i++){
            cin>>x>>y;
            if(rows.find(x)!=rows.end()){
                rows.erase(x);
            }
            if(cols.find(y)!=cols.end()){
                cols.erase(y);
            }
        }
        // for(auto itr=cols.begin();itr!=cols.end();itr++){
        //     cout<<*itr<<"\n";
        // }
        int ans=0;
        ans=rows.size()+cols.size();
        // cout<<ans<<"\n";

        n++;
        if(n%2==0 && rows.find(n/2)!=rows.end() && cols.find(n/2)!=cols.end()){
            ans--;
        }
        cout<<ans;

    }

    end_routine();
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front;
#define fbo find_by_order
#define ook order_of_key
#define lb lower_bound
#define ub upper_bound
#define rep(i,n) for(int i=0;i<n;i++)
#define fo(j,a,b) for(int j=a;j<=b;j++)
#define mem(x,a) memset(x,a,sizeof(x))

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef long double ld;
typedef map<ll,ll> spt;
typedef set<ll> si;
typedef multiset<ll>::iterator sit;
typedef map<int,int>::iterator mi;
typedef vector<int>::iterator vit;
typedef vector<ii> vii;
typedef set<ii> sii;
typedef multiset<ll> msi;
typedef vector< vector<ll> > matrix;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ost;
typedef tree<ii,null_type,greater<ii>,rb_tree_tag,tree_order_statistics_node_update> ost1;
template<class T> T chmin(T& a, T& b) { if(a>b) return a; }
template<class T> T chmax(T& a, T& b) { if(a<b) return b; }
const ll INF = 1e18;
const int MOD= 1e9 + 7;
const int N = 1e6 + 5 ;
int main()
{
    ll n,m;
    cin>>n>>m;
    spt r,c;
    ll a,b;
    rep(i,m)
    {
        cin>>a>>b;
        if(a>1 && a<n)
            r[a]++;
        if(b>1 && b<n)
            c[b]++;
    }
    ll ans=0,cnt=0;
    for(int i=2;i<n;i++)
    {
        if(r[i]==0 && c[i]>0)
            ans++;
        else if(c[i]==0 && r[i]>0)
            ans++;
        else if(c[i]==0 && r[i]==0)
            cnt++;
    }
    cout<<ans+(cnt-(cnt/2))<<"\n";
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front;
#define fbo find_by_order
#define ook order_of_key
#define lb lower_bound
#define ub upper_bound
#define rep(i,n) for(int i=0;i<n;i++)
#define fo(j,a,b) for(int j=a;j<=b;j++)
#define mem(x,a) memset(x,a,sizeof(x))

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef long double ld;
typedef map<ll,ll> spt;
typedef set<ll> si;
typedef multiset<ll>::iterator sit;
typedef map<int,int>::iterator mi;
typedef vector<int>::iterator vit;
typedef vector<ii> vii;
typedef set<ii> sii;
typedef multiset<ll> msi;
typedef vector< vector<ll> > matrix;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ost;
typedef tree<ii,null_type,greater<ii>,rb_tree_tag,tree_order_statistics_node_update> ost1;
template<class T> T chmin(T& a, T& b) { if(a>b) return a; }
template<class T> T chmax(T& a, T& b) { if(a<b) return b; }
const ll INF = 1e18;
const int MOD= 1e9 + 7;
const int N = 1e6 + 5 ;
int main()
{
    ll n,m;
    cin>>n>>m;
    spt r,c;
    ll a,b;
    rep(i,m)
    {
        cin>>a>>b;
        if(a>1 && a<n)
            r[a]++;
        if(b>1 && b<n)
            c[b]++;
    }
    ll ans=0,cnt=0;
    for(int i=2;i<n;i++)
    {
        if(r[i]==0 && c[i]>0)
            ans++;
        else if(c[i]==0 && r[i]>0)
            ans++;
        else if(c[i]==0 && r[i]==0)
            if(n-i!=i-1)
            cnt++;
        else
            ans++;
    }
    cout<<ans+2*(cnt-(cnt/2))<<"\n";
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front;
#define fbo find_by_order
#define ook order_of_key
#define lb lower_bound
#define ub upper_bound
#define rep(i,n) for(int i=0;i<n;i++)
#define fo(j,a,b) for(int j=a;j<=b;j++)
#define mem(x,a) memset(x,a,sizeof(x))

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef long double ld;
typedef map<ll,ll> spt;
typedef set<ll> si;
typedef multiset<ll>::iterator sit;
typedef map<int,int>::iterator mi;
typedef vector<int>::iterator vit;
typedef vector<ii> vii;
typedef set<ii> sii;
typedef multiset<ll> msi;
typedef vector< vector<ll> > matrix;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ost;
typedef tree<ii,null_type,greater<ii>,rb_tree_tag,tree_order_statistics_node_update> ost1;
template<class T> T chmin(T& a, T& b) { if(a>b) return a; }
template<class T> T chmax(T& a, T& b) { if(a<b) return b; }
const ll INF = 1e18;
const int MOD= 1e9 + 7;
const int N = 1e6 + 5 ;
int main()
{
    ll n,m;
    cin>>n>>m;
    spt r,c;
    ll a,b;
    rep(i,m)
    {
        cin>>a>>b;
        if(a>1 && a<n)
            r[a]++;
        if(b>1 && b<n)
            c[b]++;
    }
    ll ans=0;
    for(int i=2;i<n;i++)
    {
        if(r[i]==0 && c[i]>0)
            ans++;
        else if(c[i]==0 && r[i]>0)
            ans++;
        else if(c[i]==0 && r[i]==0)
            ans++;
    }
    cout<<ans<<"\n";
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front;
#define fbo find_by_order
#define ook order_of_key
#define lb lower_bound
#define ub upper_bound
#define rep(i,n) for(int i=0;i<n;i++)
#define fo(j,a,b) for(int j=a;j<=b;j++)
#define mem(x,a) memset(x,a,sizeof(x))

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef long double ld;
typedef map<ll,ll> spt;
typedef set<ll> si;
typedef multiset<ll>::iterator sit;
typedef map<int,int>::iterator mi;
typedef vector<int>::iterator vit;
typedef vector<ii> vii;
typedef set<ii> sii;
typedef multiset<ll> msi;
typedef vector< vector<ll> > matrix;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ost;
typedef tree<ii,null_type,greater<ii>,rb_tree_tag,tree_order_statistics_node_update> ost1;
template<class T> T chmin(T& a, T& b) { if(a>b) return a; }
template<class T> T chmax(T& a, T& b) { if(a<b) return b; }
const ll INF = 1e18;
const int MOD= 1e9 + 7;
const int N = 1e6 + 5 ;
int main()
{
    ll n,m;
    cin>>n>>m;
    spt r,c;
    ll a,b;
    rep(i,m)
    {
        cin>>a>>b;
        if(a>1 && a<n)
            r[a]++;
        if(b>1 && b<n)
            c[b]++;
    }
    ll ans=0,cnt=0;
    for(int i=2;i<n;i++)
    {
        if(r[i]==0 && c[i]>0)
            ans++;
        else if(c[i]==0 && r[i]>0)
            ans++;
        else if(c[i]==0 && r[i]==0)
            if(n-i!=i-1)
            cnt++;
        else
            ans++;
    }
    cout<<ans+2*(cnt)<<"\n";
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
#define sz(x) (int)(x).size()

const int N = 1e3 + 666;
vector<ii> adj[N][N];
int n, m, rowBad[N], colBad[N];
int vis[N][N], sel[N][N];
vector<ii> vtx;

void dfs (int u, int v) {
  vis[u][v] = 1;
  vtx.push_back({u, v});
  for (ii z : adj[u][v]) {
    if (!vis[z.first][z.second]) dfs(z.first, z.second);
  }
}

int calc (int i) {
  if (i == sz(vtx)) {
    int res = 0;
    for (ii t : vtx) res += sel[t.first][t.second];
    return res;
  }
  int x = vtx[i].first, y = vtx[i].second;
  int ans = 0;
  bool can = true;
  for (ii t : adj[x][y]) {
    if (sel[t.first][t.second]) {
      can = false;
      break;
    }
  }
  if (can) {
    sel[x][y] = 1;
    ans = max(ans, calc(i + 1));
    sel[x][y] = 0;
  }
  ans = max(ans, calc(i + 1));
  return ans;
}

int calc (int i, int j) {
  vtx.clear();
  dfs(i, j);
  return calc(0);
}

void addEdge (ii u, ii v) {
  if (rowBad[u.first] || rowBad[v.first]) return;
  if (colBad[u.second] || colBad[v.second]) return;
  adj[u.first][u.second].push_back(v);
  adj[v.first][v.second].push_back(u);
}

int solve() {
  for (int i = 2; i < n; i++) {
    addEdge({i, 1}, {i, n});
    addEdge({i, 1}, {1, i});
    addEdge({i, 1}, {n, n - i + 1});
    addEdge({1, i}, {n, i});
    addEdge({1, i}, {n - i + 1, n});
    addEdge({n, n - i + 1}, {n - i + 1, n});
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (adj[i][j].empty() || vis[i][j]) continue;
      ans += calc(i, j);
    }
  }
  return ans;
}

int main() {
  ios_base::sync_with_stdio(0); cin.tie(0);

  int x, y;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    rowBad[x] = colBad[y] = 1;
  }
  rowBad[1] = rowBad[n] = 0;
  colBad[1] = colBad[n] = 0;
  cout << solve() << '\n';
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
#define sz(x) (int)(x).size()

const int N = 1e3 + 666;
int rowBad[N], colBad[N], n;

int solve() {
  int ans = 0;
  for (int i = 2; i <= n / 2; i++) {
    ans += !rowBad[i];
    ans += !colBad[i];
    ans += !rowBad[n - i + 1];
    ans += !colBad[n - i + 1];
  }
  if (n & 1) {
    ans += !rowBad[n / 2 + 1] || !colBad[n / 2 + 1];
  }
  return ans;
}

int main() {
  ios_base::sync_with_stdio(0); cin.tie(0);

  int t, u, v;
  cin >> n >> t;
  for (int i = 0; i < t; i++) {
    cin >> u >> v;
    rowBad[u] = colBad[v] = 1;
  }
  cout << solve() << '\n';
}


#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define ull unsigned long long int
#define N (ll)(  (1e5 + 10  ) )
#define MOD (ll)(1e9+9)
#define INF (ll)(1e16)
#define P 31

using namespace std;

struct custom_hash {
	static uint64_t splitmix64(uint64_t x) {
		// http://xorshift.di.unimi.it/splitmix64.c
		x += 0x9e3779b97f4a7c15;
		x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
		x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
		return x ^ (x >> 31);
	}

	size_t operator()(uint64_t x) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		return splitmix64(x + FIXED_RANDOM);
	}
};

bool rowban[1002] = {0} ;
bool colban[1002] = {0} ;
bool rowhired[1002][2] = {0} ;

int main()
{
	ios_base::sync_with_stdio(false) ;
	cin.tie(0) ;
	cout.tie(0) ;

#ifndef ONLINE_JUDGE

	freopen("input1.txt", "r", stdin) ;
	freopen("output1.txt", "w", stdout) ;

#endif

	ll n, m ;
	cin >> n >> m ;

	for (ll i = 0; i < m; i++) {

		ll r, c ;
		cin >> r >> c ;

		rowban[r] = 1 ;
		colban[c] = 1 ;

	}

	ll ans = 0 ;

	for (ll i = 2; i <= n - 1; i++) {

		if ( !rowban[i]  ) {
			ans++;
			rowhired[i][0] = 1 ;
			rowhired[i][1] = 1 ;

		}

	}

	//cout << ans << "\n" ;

	for (ll i = 2; i <= n - 1; i++) {

		if ( colban[i] )continue ;

		if ( rowhired[i][0] ) {

			if ( rowhired[i][1] ) {
				rowhired[i][0] = 0 ;
				ans++;
				continue ;

			}

		}

		if ( rowhired[n - i + 1][1] ) {

			if ( rowhired[n - i + 1][0] ) {
				rowhired[n - i + 1][1] = 0;
				ans++;
				continue ;
			}

		}

		if ( rowhired[i][0] == 0 && rowhired[i][1] == 0 ) {

			ans++; continue ;
		}

		if ( rowhired[n - i + 1][0] == 0 && rowhired[n - i + 1][1] == 0 )ans++;

	}

	cout << ans << "\n" ;

}


#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define ull unsigned long long int
#define N (ll)(  (1e5 + 10  ) )
#define MOD (ll)(1e9+9)
#define INF (ll)(1e16)
#define P 31

using namespace std;

struct custom_hash {
	static uint64_t splitmix64(uint64_t x) {
		// http://xorshift.di.unimi.it/splitmix64.c
		x += 0x9e3779b97f4a7c15;
		x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
		x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
		return x ^ (x >> 31);
	}

	size_t operator()(uint64_t x) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		return splitmix64(x + FIXED_RANDOM);
	}
};

bool rowban[1002] = {0} ;
bool colban[1002] = {0} ;
bool rowhired[1002][2] = {0} ;

int main()
{
	ios_base::sync_with_stdio(false) ;
	cin.tie(0) ;
	cout.tie(0) ;

#ifndef ONLINE_JUDGE

	freopen("input1.txt", "r", stdin) ;
	freopen("output1.txt", "w", stdout) ;

#endif

	ll n, m ;
	cin >> n >> m ;

	for (ll i = 0; i < m; i++) {

		ll r, c ;
		cin >> r >> c ;

		rowban[r] = 1 ;
		colban[c] = 1 ;

	}

	ll ans = 0 ;

	for (ll i = 2; i <= n - 1; i++) {

		if ( !rowban[i]  ) {
			ans++;
			rowhired[i][0] = 1 ;
			rowhired[i][1] = 1 ;

		}

	}

	//cout << ans << "\n" ;

	for (ll i = 2; i <= n - 1; i++) {

		if ( colban[i] )continue ;

		if ( rowhired[i][0] ) {

			if ( rowhired[i][1] && ( n - i + 1 != i ) ) {
				rowhired[i][0] = 0 ;
				ans++;
				continue ;

			}

		}

		if ( rowhired[n - i + 1][1] ) {

			if ( rowhired[n - i + 1][0] && ( n - i + 1 != i ) ) {
				rowhired[n - i + 1][1] = 0;
				ans++;
				continue ;
			}

		}

		if ( rowhired[i][0] == 0 && rowhired[i][1] == 0 ) {

			ans++; continue ;
		}

		if ( rowhired[n - i + 1][0] == 0 && rowhired[n - i + 1][1] == 0 )ans++;

	}

	cout << ans << "\n" ;

}


#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define ull unsigned long long int
#define N (ll)(  (1e5 + 10  ) )
#define MOD (ll)(1e9+9)
#define INF (ll)(1e16)
#define P 31

using namespace std;

struct custom_hash {
	static uint64_t splitmix64(uint64_t x) {
		// http://xorshift.di.unimi.it/splitmix64.c
		x += 0x9e3779b97f4a7c15;
		x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
		x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
		return x ^ (x >> 31);
	}

	size_t operator()(uint64_t x) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		return splitmix64(x + FIXED_RANDOM);
	}
};

bool rowban[1002] = {0} ;
bool colban[1002] = {0} ;
bool rowhired[1002] = {0} ;
bool colhired[1002] = {0} ;

int main()
{
	ios_base::sync_with_stdio(false) ;
	cin.tie(0) ;
	cout.tie(0) ;

#ifndef ONLINE_JUDGE

	freopen("input1.txt", "r", stdin) ;
	freopen("output1.txt", "w", stdout) ;

#endif

	ll n, m ;
	cin >> n >> m ;

	for (ll i = 0; i < m; i++) {

		ll r, c ;
		cin >> r >> c ;

		rowban[r] = 1 ;
		colban[c] = 1 ;

	}

	ll ans = 0 ;

	for (ll i = 2; i <= n - 1; i++) {

		if ( !rowban[i]  ) {
			ans++;
			rowhired[i] = 1 ;

		}

	}

	//cout << ans << "\n" ;

	for (ll i = 2; i <= n - 1; i++) {

		if ( colban[i] )continue ;

		if ( !rowhired[i] )ans++;

		else {

			if ( !rowhired[ n - i + 1 ] )ans++;

		}

	}

	cout << ans << "\n" ;

}


#include<bits/stdc++.h>
using namespace std;

#define ll long long

#define fr(i,a,b) for (ll i = (a), _b = (b); i <= _b; i++)
#define frr(i,a,b) for (ll i = (a), _b = (b); i >= _b; i--)
#define rep(i,n) for (ll i = 0, _n = (n); i < _n; i++)
#define repr(i,n) for (ll i = n - 1; i >= 0; i--)
#define fill(ar,val) memset(ar, val, sizeof(ar))
#define fill0(ar) fill((ar), 0)
#define debug(x) cout<<#x<<": "<<x<<endl

#define ld double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second

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

#define INF 1000000000000000000

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

 	ll n,m;
    cin >> n >> m;

    ll row[n];
    ll col[n];

    fill0(row);
    fill0(col);
    row[0] = 1;
    row[n-1] = 1;
    col[0] = 1;
    col[n-1] = 1;

    rep(i,m)
    {
        ll x,y;
        cin >> x >> y;

        row[x-1] = 1;
        col[y-1] = 1;
    }

    ll ans = 0;
    rep(i,n)
    {
        if(row[i] == 0)
        {
            ans++;
        }
    }

    rep(i,n)
    {
        if(col[i] == 0)
        {
            ans++;
        }
    }

    if(n%2!=0)
    {
        if(row[n/2] == 0 && col[n/2] == 0)
            ans--;
    }
    cout << ans << endl;
}


#include<bits/stdc++.h>
using namespace std;

#define ll long long

#define fr(i,a,b) for (ll i = (a), _b = (b); i <= _b; i++)
#define frr(i,a,b) for (ll i = (a), _b = (b); i >= _b; i--)
#define rep(i,n) for (ll i = 0, _n = (n); i < _n; i++)
#define repr(i,n) for (ll i = n - 1; i >= 0; i--)
#define fill(ar,val) memset(ar, val, sizeof(ar))
#define fill0(ar) fill((ar), 0)
#define debug(x) cout<<#x<<": "<<x<<endl

#define ld double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second

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

#define INF 1000000000000000000

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

 	ll n,m;
    cin >> n >> m;

    ll row[n];
    ll col[n];

    fill0(row);
    fill0(col);
    row[0] = 1;
    row[n-1] = 1;
    col[0] = 1;
    col[n-1] = 1;

    rep(i,m)
    {
        ll x,y;
        cin >> x >> y;

        row[x-1] = 1;
        col[y-1] = 1;
    }

    ll ans = 0;
    rep(i,n)
    {
        if(row[i] == 0)
        {
            ans++;
            col[i] = 1;
        }
    }

    rep(i,n)
    {
        if(col[i] == 0)
        {
            ans++;
        }
    }

    cout << ans << endl;
}


// In the Name of Allah
// Ya Ali

#include <bits/stdc++.h>

using namespace std;

typedef long long ll ;

#define F first
#define S second
#define all( x ) x.begin() , x.end()
#define pb push_back

const int maxn = 2e5 + 10 ;
const int mod = 1e9 + 7 ;
const ll INF = 1e18 ;

int n , t , a[ maxn ] , sum = 0 ;

bool havel_hakimi()
{
  multiset< int > ss ;
  for(int i = 1 ; i <= n ; i ++)ss.insert( a[ i ] ) ;

  while( ss.size() > 1 ){
     auto it = ss.end();

     it -- ;
     int x1 = (*it);

     it --;
     int x2 = (*it);

     ss.erase( ss.find( x1 ) ) ;
     ss.erase( ss.find( x2 ) ) ;

     x1 -- ;
     x2 -- ;

     if( x1 > 0 )ss.insert( x1 );
     if( x2 > 0 )ss.insert( x2 );
  }

  return ( ss.size() == 0 );
}

signed main()
{
 ios_base::sync_with_stdio( 0 ) , cin.tie( 0 ) , cout.tie( 0 ) ;

 cin >> t ;
 while( t -- ){
    cin >> n ;
    for(int i = 1 ; i <= n ; i ++){
        cin >> a[ i ];
        sum += a[ i ];
    }
    if( sum%2 == 1 ){
        cout << "T\n" ;
        continue;
    }

    if( havel_hakimi() )cout << "HL\n";
    else cout << "T\n" ;
 }

    return 0;
}


// In the Name of Allah
// Ya Ali

#include <bits/stdc++.h>

using namespace std;

typedef long long ll ;

#define F first
#define S second
#define all( x ) x.begin() , x.end()
#define pb push_back

const int maxn = 2e5 + 10 ;
const int mod = 1e9 + 7 ;
const ll INF = 1e18 ;

int n , t , a[ maxn ] , sum = 0 ;

bool havel_hakimi()
{
  multiset< int > ss ;
  for(int i = 1 ; i <= n ; i ++)ss.insert( a[ i ] ) ;

  while( ss.size() > 1 ){
     auto it = ss.end();

     it -- ;
     int x1 = (*it);

     it --;
     int x2 = (*it);

     ss.erase( ss.find( x1 ) ) ;
     ss.erase( ss.find( x2 ) ) ;

     x1 -- ;
     x2 -- ;

     if( x1 > 0 )ss.insert( x1 );
     if( x2 > 0 )ss.insert( x2 );
  }

  return ( ss.size() == 0 );
}

signed main()
{
 ios_base::sync_with_stdio( 0 ) , cin.tie( 0 ) , cout.tie( 0 ) ;

 cin >> t ;
 while( t -- ){
    cin >> n ;
    sum = 0;
    for(int i = 1 ; i <= n ; i ++){
        cin >> a[ i ];
        sum += a[ i ];
    }
    if( sum%2 == 1 ){
        cout << "T\n" ;
        continue;
    }

    if( havel_hakimi() )cout << "HL\n";
    else cout << "T\n" ;
 }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int t;
  cin >> t;
  for (int i = 0; i < t; i++){
    int n;
    cin >> n;
    vector<int> a(n);
    for (int j = 0; j < n; j++){
      cin >> a[j];
    }
    set<int> st;
    for (int j = 0; j < n; j++){
      st.insert(a[j]);
    }
    if (st.size() == n){
      cout << "T" << endl;
    } else {
      cout << "HL" << endl;
    }
  }
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int t;
  cin >> t;
  for (int i = 0; i < t; i++){
    int n;
    cin >> n;
    vector<int> a(n);
    for (int j = 0; j < n; j++){
      cin >> a[j];
    }
    int M = 0;
    int X = 0;
    for (int j = 0; j < n; j++){
      M = max(M, a[j]);
      X = X ^ a[j];
    }
    if (M == 1){
      if (n % 2 == 1){
        cout << "T" << endl;
      } else {
        cout << "HL" << endl;
      }
    } else {
      if (X != 0){
        cout << "T" << endl;
      } else {
        cout << "HL" << endl;
      }
    }
  }
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int t;
  cin >> t;
  for (int i = 0; i < t; i++){
    int n;
    cin >> n;
    vector<int> a(n);
    for (int j = 0; j < n; j++){
      cin >> a[j];
    }
    int S = 0;
    for (int j = 0; j < n; j++){
      S += a[j];
    }
    if (n == 1){
      cout << "T" << endl;
    } else if (n == 2){
      if (a[0] == 1 && a[1] == 1){
        cout << "HL" << endl;
      } else if (a[0] % 2 == 1 || a[1] % 2 == 1){
        cout << "T" << endl;
      } else {
        cout << "HL" << endl;
      }
    } else if (S % 2 == 1){
      cout << "T" << endl;
    } else {
      cout << "HL" << endl;
    }
  }
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int t;
  cin >> t;
  for (int i = 0; i < t; i++){
    int n;
    cin >> n;
    vector<int> a(n);
    for (int j = 0; j < n; j++){
      cin >> a[j];
    }
    int S = 0;
    for (int j = 0; j < n; j++){
      S += a[j];
    }
    if (n == 1){
      cout << "T" << endl;
    } else if (n == 2){
      if ((a[0] % 2 == 1 || a[1] % 2 == 1) && a[0] != a[1]){
        cout << "T" << endl;
      } else {
        cout << "HL" << endl;
      }
    } else if (S % 2 == 1){
      cout << "T" << endl;
    } else {
      cout << "HL" << endl;
    }
  }
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int t;
  cin >> t;
  for (int i = 0; i < t; i++){
    int n;
    cin >> n;
    vector<int> a(n);
    int M = 0;
    for (int j = 0; j < n; j++){
      cin >> a[j];
      M = max(M, a[j]);
    }
    if (n == 1){
      cout << "T" << endl;
    } else if (n == 2){
      if (a[0] == a[1]){
        cout << "HL" << endl;
      } else {
        cout << "T" << endl;
      }
    } else if (M == 1){
      if (n % 2 == 1){
        cout << "T" << endl;
      } else {
        cout << "HL" << endl;
      }
    } else {
      cout << "T" << endl;
    }
  }
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int t;
  cin >> t;
  for (int i = 0; i < t; i++){
    int n;
    cin >> n;
    vector<int> a(n);
    for (int j = 0; j < n; j++){
      cin >> a[j];
    }
    sort(a.begin(), a.end());
    int S = 0;
    for (int j = 0; j < n; j++){
      S += a[j];
    }
    if (n == 1){
      cout << "T" << endl;
    } else if (S % 2 == 1){
      cout << "T" << endl;
    } else if (S - a[n - 1] >= a[n - 1]){
      cout << "HL" << endl;
    } else {
      cout << "T" << endl;
    }
  }
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int t;
  cin >> t;
  for (int i = 0; i < t; i++){
    int n;
    cin >> n;
    vector<int> a(n);
    for (int j = 0; j < n; j++){
      cin >> a[j];
    }
    int S = 0;
    for (int j = 0; j < n; j++){
      S += a[j];
    }
    if (n == 1){
      cout << "T" << endl;
    } else if (n == 2){
      if (a[0] != a[1]){
        cout << "T" << endl;
      } else {
        cout << "HL" << endl;
      }
    } else if (S % 2 == 1){
      cout << "T" << endl;
    } else {
      cout << "HL" << endl;
    }
  }
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int t;
  cin >> t;
  for (int i = 0; i < t; i++){
    int n;
    cin >> n;
    vector<int> a(n);
    for (int j = 0; j < n; j++){
      cin >> a[j];
    }
    set<int> st;
    for (int j = 0; j < n; j++){
      st.insert(a[j]);
    }
    if ((n - st.size()) % 2 == 0){
      cout << "T" << endl;
    } else {
      cout << "HL" << endl;
    }
  }
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int t;
  cin >> t;
  for (int i = 0; i < t; i++){
    int n;
    cin >> n;
    vector<int> a(n);
    for (int j = 0; j < n; j++){
      cin >> a[j];
    }
    int S = 0;
    for (int j = 0; j < n; j++){
      S += a[j];
    }
    if (n == 1){
      cout << "T" << endl;
    } else if (S % 2 == 1){
      cout << "T" << endl;
    } else {
      cout << "HL" << endl;
    }
  }
}


#include<bits/stdc++.h>
#define ll long long
#define llINF 9223372036854775807
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;

vector<ll>num;

int32_t main()
{
    IOS;
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        num.clear();
        num.resize(n);
        ll num1=0,num2=0;
        for(int i=0;i<n;i++) cin>>num[i];
        sort(num.begin(),num.end());
        for(int i=n-1;i>=0;i-=2)
        {
            num1+=num[i];
        }
        for(int i=n-2;i>=0;i-=2)
        {
            num2+=num[i];
        }
        if(num1>num2) cout<<"T"<<endl;
        else cout<<"HL"<<endl;
    }
}


#include<bits/stdc++.h>
#define ll long long
#define llINF 9223372036854775807
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;

vector<ll>num;

int32_t main()
{
    IOS;
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        num.resize(n);
        ll num1=0,num2=0;
        for(int i=0;i<n;i++) cin>>num[i];
        for(int i=n-1;i>=0;i-=2)
        {
            num1+=num[i];
        }
        for(int i=n-2;i>=0;i-=2)
        {
            num2+=num[i];
        }
        if(num1>num2) cout<<"T"<<endl;
        else cout<<"HL"<<endl;
    }
}


#include<bits/stdc++.h>
#define ll long long
#define llINF 9223372036854775807
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;

vector<ll>num;

int32_t main()
{
    IOS;
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        num.clear();
        num.resize(n);
        ll sum=0;
        for(int i=0;i<n;i++)
        {
            cin>>num[i];
            sum+=num[i];
        }
        sort(num.begin(),num.end());
        if(n==1) cout<<"T"<<endl;
        else if(n==2)
        {
            if(num[1]>num[0]) cout<<"T"<<endl;
            else cout<<"HL"<<endl;
        }
        else
        {
            if(num[n-1]*2>sum) cout<<"T"<<endl;
            else
            {
                if(sum&1) cout<<"T"<<endl;
                else cout<<"HL"<<endl;
            }
        }
    }
}


#include<bits/stdc++.h>
#define ll long long
#define llINF 9223372036854775807
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;

vector<ll>num;

int32_t main()
{
    IOS;
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        num.resize(n);
        ll num1=0,num2=0;
        for(int i=0;i<n;i++) cin>>num[i];
        sort(num.begin(),num.end());
        for(int i=n-1;i>=0;i-=2)
        {
            num1+=num[i];
        }
        for(int i=n-2;i>=0;i-=2)
        {
            num2+=num[i];
        }
        if(num1>num2) cout<<"T"<<endl;
        else cout<<"HL"<<endl;
    }
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <iomanip>
#include <bitset>
#include <unordered_map>
#include <stack>
#include <memory.h>
#include <list>
#include <numeric>
#include <functional>
#include <complex>
#include <cassert>
#include <regex>
#include <random>
#include <unordered_set>
#include <climits>

using namespace std;

typedef long long li;

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int t;
	cin >> t;

	while (t--) {
		int n;
		cin >> n;
		int mx = 0;
		int sum = 0;
		for (int i = 0; i < n; i++) {
			int x;
			cin >> x;
			sum += x;
			mx = max(mx, x);
		}

		if (2 * mx > sum || sum % 2) cout << "T\n";
		else cout << "HL\n";
	}
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <iomanip>
#include <bitset>
#include <unordered_map>
#include <stack>
#include <memory.h>
#include <list>
#include <numeric>
#include <functional>
#include <complex>
#include <cassert>
#include <regex>
#include <random>
#include <unordered_set>
#include <climits>

using namespace std;

typedef long long li;

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int t;
	cin >> t;

	while (t--) {
		int n;
		cin >> n;
		int mx = 0;
		int sum = 0;
		for (int i = 0; i < n; i++) {
			int x;
			cin >> x;
			sum += x;
			mx = max(mx, x);
		}

		if (2 * mx > sum || n % 2) cout << "T\n";
		else cout << "HL" << '\n';
	}
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <iomanip>
#include <bitset>
#include <unordered_map>
#include <stack>
#include <memory.h>
#include <list>
#include <numeric>
#include <functional>
#include <complex>
#include <cassert>
#include <regex>
#include <random>
#include <unordered_set>
#include <climits>

using namespace std;

typedef long long li;

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int t;
	cin >> t;

	while (t--) {
		int n;
		cin >> n;
		int mx = 0;
		int sum = 0;
		for (int i = 0; i < n; i++) {
			int x;
			cin >> x;
			sum += x;
			mx = max(mx, x);
		}

		if (2 * mx > sum) {
			cout << "T\n";
		}
		else {
			cout << (n % 2 ? "T" : "HL") << '\n';
		}
	}
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define rep(i,a,n) for (ll i=a;i<n;i++)
#define per(i,a,n) for (ll i=n-1;i>=a;i--)
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
#define sz(s) (int)s.size()
#define clr(v, d) memset(v, d, sizeof(v))
#define pp push_back
#define pb pop_back
#define pi acos(-1)
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef unsigned long long int ull;
typedef double long dl;
typedef vector<ll> vi;
typedef pair<int, string> pa;
const int N = 1e5 + 9, oo = 1e9;
void solve() {
	int n, x = 0, y = 0;
	cin >> n;
	vector<int>v(n);
	rep(i, 0, n) cin >> v[i];
	sort(rall(v));
	rep(i, 0, n) {
		 x = max(v[i],x);
		 y += v[i];
	}
	if (2*x>y||(y-2*x)%2)cout << "T" << endl;
	else cout << "HL" << endl;
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
	//freopen("stars.in", "r", stdin);
	int t = 1;
	cin >> t;
	while (t--)
		solve();

}


#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define rep(i,a,n) for (ll i=a;i<n;i++)
#define per(i,a,n) for (ll i=n-1;i>=a;i--)
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
#define sz(s) (int)s.size()
#define clr(v, d) memset(v, d, sizeof(v))
#define pp push_back
#define pb pop_back
#define pi acos(-1)
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef unsigned long long int ull;
typedef double long dl;
typedef vector<ll> vi;
typedef pair<int, string> pa;
const int N = 1e5 + 9, oo = 1e9;
void solve() {
	int n, x = 0, y = 0;
	cin >> n;
	vector<int>v(n);
	rep(i, 0, n) cin >> v[i];
	sort(rall(v));
	rep(i, 0, n) {
		if (x <= y) x += v[i];
		else y += v[i];
	}
	if (x - y)cout << "T" << endl;
	else cout << "HL" << endl;
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
	//freopen("stars.in", "r", stdin);
	int t = 1;
	cin >> t;
	while (t--)
		solve();

}


#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define rep(i,a,n) for (ll i=a;i<n;i++)
#define per(i,a,n) for (ll i=n-1;i>=a;i--)
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
#define sz(s) (int)s.size()
#define clr(v, d) memset(v, d, sizeof(v))
#define pp push_back
#define pb pop_back
#define pi acos(-1)
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef unsigned long long int ull;
typedef double long dl;
typedef vector<ll> vi;
typedef pair<int, string> pa;
const int N = 1e5 + 9, oo = 1e9;
void solve() {
	int n, x = 0, y = 0;
	cin >> n;
	vector<int>v(n);
	rep(i, 0, n) cin >> v[i];
	sort(rall(v));
	rep(i, 0, n) {
		if (x <= y) x += v[i];
		else y += v[i];
	}
	if (x - y)cout << "T" << endl;
	else cout << "HT" << endl;
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
	//freopen("stars.in", "r", stdin);
	int t = 1;
	cin >> t;
	while (t--)
		solve();

}


#include <bits/stdc++.h>

#define f first
#define s second
#define x first
#define y second

using namespace std;
using li = long long;
using ld = long double;
using pii = pair<int, int>;

const int INF = 1e9 + 13;
const int M = 1e9 + 7;
const int N = 1e5 + 13;
const int A = 26;

/*
1
2
2 2
*/

void solve() {
    int n;
    cin >> n;

    vector<int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }

    int lst = -1;
    int cur = 0;
    while(true) {
        int mx = -1;
        for(int i = 0; i < n; i++) {
            if(i != lst && (mx == -1 || a[mx] < a[i])) {
                mx = i;
            }
        }
        if(mx == -1 || a[mx] == 0)
            break;

        a[mx]--;
        lst = mx;
        cur++;
    }

    cout << (cur % 2 == 1 ? "T" : "HL") << endl;
}

int main() {
//    ios::sync_with_stdio(0);
//    cin.tie(0);
    int t = 1;
    cin >> t;

    while(t--)
        solve();
}


#include <bits/stdc++.h>

#define f first
#define s second
#define x first
#define y second

using namespace std;
using li = long long;
using ld = long double;
using pii = pair<int, int>;

const int INF = 1e9 + 13;
const int M = 1e9 + 7;
const int N = 1e5 + 13;
const int A = 26;

/*
1
2
2 2
*/

void solve() {
    int n;
    cin >> n;

    vector<int> a(n);
    int s = 0;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        s += a[i];
    }

    vector<bool> dp(1013, false);
    dp[0] = true;
    for(int i = 0; i < n; i++) {
        for(int j = dp.size() - 1; j >= 0; j--)
            if(j < s - a[i] && dp[j])
                dp[j + a[i]] = true;
    }

    cout << (s % 2 == 1 || !dp[s / 2] ? "T" : "HL") << endl;
}

int main() {
//    ios::sync_with_stdio(0);
//    cin.tie(0);
    int t = 1;
    cin >> t;

    while(t--)
        solve();
}


#include <bits/stdc++.h>

#define f first
#define s second
#define x first
#define y second

using namespace std;
using li = long long;
using ld = long double;
using pii = pair<int, int>;

const int INF = 1e9 + 13;
const int M = 1e9 + 7;
const int N = 1e5 + 13;
const int A = 26;

/*
1
2
2 2
*/

void solve() {
    int n;
    cin >> n;

    vector<int> a(n);
    int s = 0;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        s += a[i];
    }

    vector<bool> dp(10013, false);
    dp[0] = true;
    for(int i = 0; i < n; i++) {
        for(int j = dp.size() - 1; j >= 0; j--)
            if(j < s - a[i] && dp[j])
                dp[j + a[i]] = true;
    }

    cout << (s % 2 == 1 || !dp[s / 2] ? "T" : "HL") << endl;
}

int main() {
//    ios::sync_with_stdio(0);
//    cin.tie(0);
    int t = 1;
    cin >> t;

    while(t--)
        solve();
}


#include <bits/stdc++.h>

#define f first
#define s second
#define x first
#define y second

using namespace std;
using li = long long;
using ld = long double;
using pii = pair<int, int>;

const int INF = 1e9 + 13;
const int M = 1e9 + 7;
const int N = 1e5 + 13;
const int A = 26;

/*
*/

void solve() {
    int n;
    cin >> n;

    vector<int> a(n);
    int s = 0;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        s += a[i];
    }

    if(n == 1) {
        cout << "T" << endl;
    } else {
        cout << (s % 2 == 0 ? "HL" : "T") << endl;
    }
}

int main() {
//    ios::sync_with_stdio(0);
//    cin.tie(0);
    int t = 1;
    cin >> t;

    while(t--)
        solve();
}


#include <bits/stdc++.h>

#define f first
#define s second
#define x first
#define y second

using namespace std;
using li = long long;
using ld = long double;
using pii = pair<int, int>;

const int INF = 1e9 + 13;
const int M = 1e9 + 7;
const int N = 1e5 + 13;
const int A = 26;

/*
1
2
2 2
*/

void solve() {
    int n;
    cin >> n;

    vector<int> a(n);
    int s = 0;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        s += a[i];
    }

    if(n == 1) {
        cout << "T" << endl;
        return;
    }

    if(n == 2) {
        cout << (a[0] == a[1] ? "HL" : "T") << endl;
        return;
    }

    cout << (s % 2 == 1 ? "T" : "HL") << endl;
}

int main() {
//    ios::sync_with_stdio(0);
//    cin.tie(0);
    int t = 1;
    cin >> t;

    while(t--)
        solve();
}


#include <bits/stdc++.h>

#define f first
#define s second
#define x first
#define y second

using namespace std;
using li = long long;
using ld = long double;
using pii = pair<int, int>;

const int INF = 1e9 + 13;
const int M = 1e9 + 7;
const int N = 1e5 + 13;
const int A = 26;

/*
*/

void solve() {
    int n;
    cin >> n;

    vector<int> a(n);
    int s = 0;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        s += a[i];
    }

    vector<bool> dp(1013, false);
    dp[0] = true;
    for(int i = 0; i < n; i++) {
        for(int j = dp.size() - 1; j >= 0; j--)
            if(j < n - a[i] && dp[j])
                dp[j + a[i]] = true;
    }

    cout << (s % 2 == 1 || !dp[s / 2] ? "T" : "HL") << endl;
}

int main() {
//    ios::sync_with_stdio(0);
//    cin.tie(0);
    int t = 1;
    cin >> t;

    while(t--)
        solve();
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int max_n = 105;
const int inf = 0x3f3f3f3f;
int a[max_n];
int main() {
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        int ans=0;
        for (int i = 1; i <= n; ++i) {
            cin >> a[i];
        }
        if (n == 1) {
            cout<<"T"<<endl;
        }else{
            int sum=0,res=0;
            for(int i=1;i<=n;++i){
                if(a[i]&1){
                    sum++;
                }else{
                    if(a[i]>1){
                        ans++;
                    }
                }
            }
            ans%=2;
            res=n-sum;
            if(res%2==0){
                ans++;
            }
            if(ans&1){
                cout<<"HL"<<endl;
            }else{
                cout<<"T"<<endl;
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int max_n = 105;
const int inf = 0x3f3f3f3f;
int a[max_n];
int main() {
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        int ans=0;
        for (int i = 1; i <= n; ++i) {
            cin >> a[i];
        }
        if (n == 1) {
            cout<<"T"<<endl;
        }else{
            int sum=0,res=0;
            for(int i=1;i<=n;++i){
                if(a[i]&1){
                    sum++;
                }else{
                    if(a[i]>1){
                        ans++;
                    }
                }
            }
            res=n-sum;
            if(res&1){
                ans++;
            }
            if(ans&1){
                cout<<"T"<<endl;
            }else{
                cout<<"HL"<<endl;
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int max_n = 105;
const int inf = 0x3f3f3f3f;
int a[max_n];
int main() {
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        int ans=0;
        int sum=0,ma=0;
        for (int i = 1; i <= n; ++i) {
            cin >> a[i];
            sum+=a[i];
            ma=max(ma,a[i]);
        }
        if(ma>sum/2){
            printf("T\n");
        }else{
            if(sum&1){
                cout<<"T"<<endl;
            }else{
                cout<<"HL"<<endl;
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int max_n = 105;
const int inf = 0x3f3f3f3f;
int a[max_n];
int main() {
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        int ans=0;
        for (int i = 1; i <= n; ++i) {
            cin >> a[i];
        }
        if (n == 1) {
            cout<<"T"<<endl;
        }else{
            int sum=0,res=0;
            for(int i=1;i<=n;++i){
                if(a[i]&1){
                    sum++;
                    ans++;
                }else{
                    if(a[i]>1){
                        ans++;
                    }
                }
            }
            res=n-sum;
            if(res&1){
                ans++;
            }
            if(ans&1){
                cout<<"T"<<endl;
            }else{
                cout<<"HL"<<endl;
            }
        }
    }
    return 0;
}


#include <iostream>
#include <vector>

using namespace std;

int main() {
    int t, n;
    vector<int> a;
    cin >> t;
    while (t--) {
        cin >> n;
        a = vector<int>(n);
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }

        int p1 = 0, p2 = p1 + 1;
        while (1) {
            if (p1 >= n) {
                cout << "HL\n";
                break;
            }
            if (p2 >= n) {
                cout << "T\n";
                break;
            }

            if (a[p2] > a[p1]) swap(p1, p2);

            a[p1] -= a[p2];
            a[p2] = 0;
            p2++;
            if (a[p1] == 0) {
                p1 = p2++;
            }
        }
    }
}


#include <iostream>
#include <>

using namespace std;

int main() {
    int t, n;
    vector<int> a;
    cin >> t;
    while (t--) {
        cin >> n;
        a = vector<int>(n);
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }

        int p1 = 0, p2 = p1 + 1;
        while (1) {
            if (p1 >= n) {
                cout << "HL\n";
                break;
            }
            if (p2 >= n) {
                cout << "T\n";
                break;
            }

            if (a[p2] > a[p1]) swap(p1, p2);

            a[p1] -= a[p2];
            a[p2] = 0;
            p2++;
            if (a[p1] == 0) {
                p1 = p2++;
            }
        }
    }
}


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

using namespace std;

int main() {
    int t, n;
    vector<int> a;
    cin >> t;
    while (t--) {
        cin >> n;
        a = vector<int>(n);
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }

        bool player = 0;
        int lastIndex = -1, maxV, maxI = -1;
        while (1) {
            maxV = -1;

            for (int i = 0; i < a.size(); i++) {
                if (i == lastIndex) continue;
                if (maxV < a[i]) {
                    maxV = a[i];
                    maxI = i;
                }
            }

            if (maxV <= 0) break;

            a[maxI]--;
            lastIndex = maxI;

            player = !player;
        }

        if (player) cout << "T\n";
        else cout << "HL\n";
    }
}


#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;

int arr[100005];

int main(){
    int i,j,k,a,b,c,n,T;
    scanf("%d",&T);
    while(T--){
        scanf("%d",&n);
        b=0;c=0;
        for(i=1;i<=n;i++){
            scanf("%d",&a);
            if(a%2)b++;
            else c++;
        }
        if(n==1||(n%2==0&&(b%2||c%2))||(n%2==1&&b%2))printf("T\n");
        else printf("HL\n");
    }
}


#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;

int arr[100005];

int main(){
    int i,j,k,a,b,c,n,T;
    scanf("%d",&T);
    while(T--){
        scanf("%d",&n);
        b=0;c=0;
        for(i=1;i<=n;i++){
            scanf("%d",&a);
            if(a%2)b++;
            else c++;
        }
        if(b%2||c%2)printf("T\n");
        else printf("HL\n");
    }
}


#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;

int arr[100005];

int main(){
    int i,j,k,a,b,c,d,n,T;
    scanf("%d",&T);
    while(T--){
        scanf("%d",&n);
        b=0;c=0;d=0;
        for(i=1;i<=n;i++){
            scanf("%d",&a);
            if(a==1)d++;
            else if(a%2)b++;
            else c++;
        }
        if(n==1||((d%2+b%2==0)&&(b%2+c%2==1))||((d%2+b%2==1)&&(b%2+c%2==0)))printf("T\n");
        else printf("HL\n");
    }
}


#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;

int arr[100005];
priority_queue<int> pq;

int main(){
    int i,j,k,a,b,c,d,n,T;
    scanf("%d",&T);
    while(T--){
        while(pq.size()){
            pq.pop();
        }
        scanf("%d",&n);
        for(i=1;i<=n;i++){
            scanf("%d",&a);
            pq.push(a);
        }
        a=0;c=0;
        while(pq.size()){
            b=pq.top();pq.pop();
            c++;
            if(a)pq.push(a);
            a=b-1;
        }
        if(c%2==0)printf("HL\n");
        else printf("T\n");
    }
}


#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define ins insert
#define sz(x) (long long)x.size()
typedef long long ll;
typedef long double ld;
const int N = 3e5 + 5;
const ld pi = 3.141592653;
const ll MOD = 1e9 + 7;
const ll mod = 998244353;
const ll INF = __LONG_LONG_MAX__;

using namespace std;

int dx[9] = {1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9] = {0, 0, 1, -1, 1, -1, 1, -1, 0};

int main()
{
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        int T = 1;
        cin>>T;
        while(T--)
        {
                int n, i;
                cin>>n;
                vector<int> a(n);
                string ans;
                for(i = 0; i<n; i++) cin>>a[i];
                while(1){
                        int sum = 0;
                        sort(a.begin(), a.end());
                        for(i = 0; i<sz(a); i++) sum += a[i];
                        sum -= a.back();
                        if(sum < a.back()){
                                ans = "T"; break;
                        }
                        else if(sum == a.back()){
                                ans = "HL"; break;
                        }
                        else{
                                int d = sum - a.back(), bsum = 0;
                                vector<int> b;
                                for(i = 0; i<sz(a) - 1; i++){
                                        if(bsum + a[i] < d){
                                                bsum += a[i]; b.pb(a[i]);
                                        }
                                        else{
                                                b.pb(d - bsum); bsum = d;
                                                break;
                                        }
                                }
                                a = b;
                        }
                }
                cout<<ans<<"\n";
        }
        return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define ins insert
#define sz(x) (long long)x.size()
typedef long long ll;
typedef long double ld;
const int N = 3e5 + 5;
const ld pi = 3.141592653;
const ll MOD = 1e9 + 7;
const ll mod = 998244353;
const ll INF = __LONG_LONG_MAX__;

using namespace std;

int dx[9] = {1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9] = {0, 0, 1, -1, 1, -1, 1, -1, 0};

int main()
{
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        int T = 1;
        cin>>T;
        while(T--)
        {
                int n, i;
                cin>>n;
                vector<int> a(n);
                int ma = *max_element(a.begin(), a.end());
                int sum = accumulate(a.begin(), a.end(), 0);
                if(2 * ma > sum || sum % 2 != 0) cout<<"T";
                else cout<<"NL";
                cout<<"\n";
        }
        return 0;
}