const input = require("fs").readFileSync(0,"utf8").toString().split("\n");
let paper = Array.from({length:100},()=>new Array(100).fill(0));
let sum=0;

for(let n=1; n<=Number(input[0]); n++){
    let [x, y] = input[n].split(' ').map(Number);
    for(let i=x-1; i<x+9; i++){
        for(let j=y-1; j<y+9; j++){
            if(paper[i][j]===0){
                paper[i][j]=1;
                sum++;
            }
        }
    }
}

console.log(sum);