paper = [[0]*100 for _ in range(100)]
for _ in range(int(input())):
    x, y = map(int, input().split())
    for i in range(y-1, y+9):
        paper[i][x-1:x+9] = [1]*10
print(sum(paper[i][j] for i in range(100) for j in range(100)))