#include <bits/stdc++.h>
using namespace std;
int const mxsz = 1009;
bool Left[mxsz], Up[mxsz], Right[mxsz], Down[mxsz];
bool takeifpossible(int n) {
  n--;
  pair<int, int> dir[4];
  dir[0] = dir[1] = dir[3] = dir[2] = {3, -1};
  for (int i = 0; i < n; ++i) {
    if (Left[i]) dir[0] = min(dir[0], {Up[i] + Down[n - i], i});
    if (Right[i]) dir[1] = min(dir[1], {Up[n - i] + Down[i], i});
    if (Up[i]) dir[3] = min(dir[3], {Left[i] + Right[n - i], i});
    if (Down[i]) dir[2] = min(dir[2], {Right[i] + Left[n - i], i});
  }
  pair<int, int> p = min(min(dir[0], dir[1]), min(dir[3], dir[2]));
  int N = p.second;
  if (p.first == 3) return false;
  if (dir[0] == p)
    Right[N] = Left[N] = Up[N] = Down[n - N] = 0;
  else if (dir[1] == p)
    Right[N] = Left[N] = Down[N] = Up[n - N] = 0;
  else if (dir[3] == p)
    Up[N] = Down[N] = Left[N] = Right[n - N] = 0;
  else if (dir[2] == p)
    Up[N] = Down[N] = Right[N] = Left[n - N] = 0;
  return true;
}
int main() {
  int q, n, x, y;
  scanf("%d%d", &n, &q);
  for (int i = 1; i < n - 1; ++i) Left[i] = Up[i] = Right[i] = Down[i] = 1;
  while (q--) {
    scanf("%d%d", &x, &y);
    x--, y--;
    Left[x] = Right[x] = Up[y] = Down[y] = 0;
  }
  int t = 0;
  while (takeifpossible(n)) t++;
  cout << t << endl;
  return 0;
}
