#include <stdio.h>
int main()
{
int n, m, k;
int x, y, count = 0;
scanf("%d %d %d", &n, &m, &k);
int a[2000][2000];
int tor[15][15] = {{0, 0}, {2, 0}, {0, 2}, {-2, 0}, {0, -2}, {1, 1}, {1, 0}, {1, -1}, {0 ,1}, {0, -1}, {-1, 0}, {-1, 1}, {-1, -1}};
int ys[30][30] = {{0, 0}, {-2, -2}, {-2, -1}, {-2, 0}, {-2, 1}, {-2, 2}, {-1, -2}, {-1, -1}, {-1, 0}, {-1, 1}, {-1, 2}, {-1, -2}, {0, -1}, {0, 1}, {0, 2}, {0, -2}, {1, -1}, {1, 0}, {1, 1}, {1, 2}, {1, -2}, {2, -1}, {2, 0}, {2, 1}, {2, 2}, {2, -2}};
for(int i = 0; i <= n; i++)
{
for(int j = 0; j <= n; j++)
{
a[i][j] = 0;
}
}
for(int i = 0; i < m; i++)
{
scanf("%d %d", &x, &y);
for(int j = 0; j < 13; j++)
{
if(x + tor[j][0] >= 0 && y + tor[j][1] >= 0)
a[x + tor[j][0]][y + tor[j][1]] = 1;
}
}
for(int i = 0; i < k; i++)
{
scanf("%d %d", &x, &y);
for(int j = 0; j < 25; j++)
{
if(x + ys[j][0] >= 0 && y + ys[j][1] >= 0)
a[x + ys[j][0]][y + ys[j][1]] = 1;
}
}
for(int i = 1; i <= n; i++)
{
for(int j = 1; j <= n; j++)
{
if(a[i][j] == 0)
count++;
}
}
printf("%d", count);
return 0;
}
#include <stdio.h>
int main()
{
int n, m, k;
int x, y, count = 0;
scanf("%d %d %d", &n, &m, &k);
int a[200][200];
int torx[13] = {-2,-1,-1,-1,0,0,0,0,0,1,1,1,2},
tory[13] = {0,1,0,-1,2,1,0,-1,-2,1,0,-1,0},
ysx[25] = {-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2},
ysy[25] = { 2,1,0,-1,-2,2,1,0,-1,-2,2,1,0,-1,-2,2,1,0,-1,-2,2,1,0,-1,-2};
for(int i = 0; i <= n; i++)
{
for(int j = 0; j <= n; j++)
{
a[i][j] = 0;
}
}
for(int i = 0; i < m; i++)
{
scanf("%d %d", &x, &y);
for(int j = 0; j < 13; j++)
{
if(x + torx[j] >= 0 && y + tory[j] >= 0)
a[x + torx[j]][y + tory[j]] = 1;
}
}
for(int i = 0; i < k; i++)
{
scanf("%d %d", &x, &y);
for(int j = 0; j < 25; j++)
{
if(x + ysx[j] >= 0 && y + ysy[j] >= 0)
a[x + ysx[j]][y + ysy[j]] = 1;
}
}
for(int i = 1; i <= n; i++)
{
for(int j = 1; j <= n; j++)
{
if(a[i][j] == 0)
count++;
}
}
printf("%d", count);
return 0;
}