#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
void desperate_optimization(bool submitting = true,
                            long long int precision = 10) {
  if (!submitting) return;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.setf(ios::fixed);
  cout.setf(ios::showpoint);
  cout.precision(precision);
}
int32_t main() {
  desperate_optimization(true);
  long long int n, m;
  cin >> n >> m;
  bool grid[n][n];
  memset(grid, true, sizeof(grid));
  grid[0][0] = false;
  grid[n - 1][n - 1] = false;
  grid[0][n - 1] = false;
  grid[n - 1][0] = false;
  while (m--) {
    long long int x, y;
    cin >> x >> y;
    grid[x - 1][y - 1] = false;
    grid[0][y - 1] = false;
    grid[n - 1][y - 1] = false;
    grid[x - 1][0] = false;
    grid[x - 1][n - 1] = false;
  }
  long long int answer = 0;
  set<pair<long long int, long long int>> starting;
  for (long long int i = 1; i < n - 1; i++) {
    for (long long int j = 1; j < n - 1; j++) {
      if (grid[i][0]) starting.insert({0, i});
      if (grid[0][j]) starting.insert({j, 0});
    }
  }
  if (n % 2 && grid[(n + 1) / 2 - 1][0] && grid[0][(n + 1) / 2 - 1])
    answer = -1;
  cout << starting.size() + answer;
  return 0;
}
