#include <bits/stdc++.h>
const int N = 1005;
const int inf = 1 << 28;
const double eps = 1e-8;
using namespace std;
bool row[N], col[N];
int vis[10], cnt;
int p[10][2] = {{0, 0}, {2, 4}, {1, 7}, {4, 6}, {3, 1},
                {6, 8}, {5, 3}, {2, 8}, {7, 5}};
void dfs(int k, int sum) {
  if (k == 9) {
    cnt = max(cnt, sum);
    return;
  }
  if (!vis[k] && vis[p[k][0]] != 1 && vis[p[k][1]] != 1) {
    vis[k] = 1;
    int flag1 = 0, flag2 = 0;
    if (vis[p[k][0]] == 0) vis[p[k][0]] = 2, flag1 = 1;
    if (vis[p[k][1]] == 0) vis[p[k][1]] = 2, flag2 = 1;
    dfs(k + 1, sum + 1);
    vis[k] = 0;
    if (flag1) vis[p[k][0]] = 0;
    if (flag2) vis[p[k][1]] = 0;
  }
  dfs(k + 1, sum);
}
int main() {
  int n, m;
  while (cin >> n >> m) {
    memset(row, 0, sizeof(row));
    memset(col, 0, sizeof(col));
    int x, y, res = 0;
    for (int i = 0; i < m; i++) {
      scanf("%d%d", &x, &y);
      row[x] = col[y] = 1;
    }
    int i, j;
    for (i = 2, j = n - 1; i < j; i++, j--) {
      memset(vis, 0, sizeof(vis));
      cnt = 0;
      if (col[i]) vis[1] = vis[4] = -1;
      if (col[j]) vis[5] = vis[8] = -1;
      if (row[i]) vis[2] = vis[7] = -1;
      if (row[j]) vis[3] = vis[6] = -1;
      dfs(1, 0);
      res += cnt;
    }
    if (i == j && (!col[i] || !col[j] || !row[i] || !row[j])) res++;
    printf("%d\n", res);
  }
  return 0;
}
