import java.util.*;
public class Main {
public static void main(String[] args) {
int answer = 0;
int[][] board = new int[100][100];
Scanner sc = new Scanner(System.in);
int N = Integer.parseInt(sc.nextLine());
for (int t = 0; t < N; t++) {
StringTokenizer st = new StringTokenizer(sc.nextLine()," ");
int r = Integer.parseInt(st.nextToken());
int c = Integer.parseInt(st.nextToken());
for (int i = r; i < r+10; i++) {
for (int j = c; j < c+10; j++) {
if(i>=100 || j>=100)continue;
if(board[i][j] !=0)continue;
board[i][j] = 1;
answer++;
}
}
}
System.out.println(answer);
}
}