#include int dx[] = { 0, 1, 0, -1, 1, -1 }; int dy[] = { 1, 0, -1, 0, -1, 1 }; int N, K, x, y, l, r, qx[8002009], qy[8002009], v[4009][4009], sx[4009][4009], sy[4009][4009]; long long X; int main() { scanf("%d %d %lld", &N, &K, &X); for (int i = 0; i < N; i++) { for (int j = 0; j < N - i; j++) { v[i][j] = -1; } } for (int i = 0; i < K; i++) { scanf("%d %d", &x, &y), x = x - y, y--; if (v[x][y] == -1) v[x][y] = 0, qx[r] = x, qy[r++] = y; } while (l != r) { x = qx[l], y = qy[l++]; for (int i = 0; i < 6; i++) { int tx = x + dx[i], ty = y + dy[i]; if (0 <= tx && tx < N && 0 <= ty && ty < N && 0 <= tx + ty && tx + ty < N && v[tx][ty] == -1) { v[tx][ty] = v[x][y] + 1; qx[r] = tx, qy[r++] = ty; } } } for (int i = 0; i < N; i++) { for (int j = 0; j < N - i; j++) { sx[i][j + 1] = sx[i][j] + v[i][j]; sy[i][j + 1] = sy[i][j] + v[j][i]; } } long long ret = 0; for (int i = 0; i < N; i++) { int cx = i + 1; long long cs = 0; for (int j = 0; j <= i; j++) { while (cx != 0) { int delta = sy[cx - 1][i - cx + 2] - sy[cx - 1][j]; if (cs + delta >= X) break; cs += delta; cx--; } ret += cx; cs -= sx[j][i - j + 1] - sx[j][cx]; } } printf("%lld\n", ret); return 0; }