import java.util.*;
public class Main{
static int N = 110;
static int n, m;
static int[] dx = {-1, 0, 1, 0};
static int[] dy = {0, 1, 0, -1};
static PII[][] match = new PII[N][N];
static boolean[][] g = new boolean[N][N];
static boolean[][] st = new boolean[N][N];
public static boolean dfs(int x, int y) {
for (int i = 0; i < 4; i ++ ) { //四个方向
int a = x + dx[i], b = y + dy[i];
if (a < 1 || a > n || b < 1 || b > n) continue; //判断越界
if (st[a][b] || g[a][b]) continue; //看看这个白色格子有没有被遍历过 或者 是不是禁止放置
st[a][b] = true; //然后标记当前格子已经在这一轮被遍历过
PII t = match[a][b]; //然后看看这个白色格子是不是有黑色格子连上了
if (t == null || dfs(t.x, t.y)) { //如果没有人连 或者 他之前链接的黑色格子有其他的白色格子可以连,那么就返回true
match[a][b] = new PII(x, y); //将当前黑色格子的位置赋值给这个白色格子
return true;
}
}
return false;
}
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
n = scan.nextInt();
m = scan.nextInt();
while (m -- > 0) {
int x = scan.nextInt();
int y = scan.nextInt();
g[x][y] = true;
}
int res = 0;
for (int i = 1; i <= n; i ++ ) {
for (int j = 1; j <= n; j ++ ) {
for (int k = 0; k <= n; k ++ ) Arrays.fill(st[k], false); //因为是二维数组,所以循环重置
if ((i + j) % 2 == 0 && !g[i][j]) //判断如果是横纵坐标之和为奇数 并且 该格子不是禁止放置
if (dfs(i, j)) res ++;
}
}
System.out.println(res);
}
}
class PII {
int x, y;
public PII (int x, int y) {
this.x = x;
this.y = y;
}
}