실버5 문제
n = int(input())
arr = [[0] * 100 for _ in range(100)]
for _ in range(n):
w, h = map(int, input().split())
for i in range(h-1, h+9):
for j in range(w-1, w+9):
arr[i][j] = 1
ssum = 0
for k in range(100):
ssum = ssum + arr[k].count(1)
print(ssum)