#include <bits/stdc++.h>
using namespace std;
int A[3003], B[3003], C[3003], D[3003], E[3003], I, J, O[3003], P[3003],
    Q[3003], a[3003], b[3003], c[3003], d[3003], e[3003], i, j, k, m, n, o, p,
    y, z;
long long x;
inline bool _a(int u, int v) { return O[u] < O[v]; }
inline bool _b(int u, int v) { return P[u] < P[v]; }
int main() {
  for (scanf("%d%d%d%d", &m, &n, &o, &p), i = 1; i <= o; i++)
    scanf("%d%d", O + i, P + i), Q[i] = i;
  for (sort(Q + 1, Q + o + 1, _b), i = 1; i <= o; C[P[Q[i++]]]++)
    if (P[Q[i]] != P[Q[i - 1]]) B[A[P[Q[i]]] = P[Q[i - 1]]] = P[Q[i]];
  for (C[D[n + 1] = d[n + 1] = B[A[n + 1] = P[Q[o]]] = n + 1] = p, i = *B;
       i <= n; z += (n - D[i] + 1) * (i - A[i]), i = B[i])
    for (D[i] = D[A[i]], E[i] = E[A[i]] - C[A[i]]; E[i] < p;)
      E[i] += C[D[i] = B[D[i]]];
  for (sort(Q + 1, Q + o + 1, _a), i = I = 1; i <= m; i++) {
    for (j = *b = *B; j; j = B[j])
      a[j] = A[j], b[j] = B[j], c[j] = C[j], d[j] = D[j], e[j] = E[j];
    for (j = m, J = o, y = z; j >= i; j--)
      for (x += y; J <= o && O[Q[J]] == j; J--)
        for (k = !--c[P[Q[J]]]
             ? y -= (d[b[P[Q[J]]]] - d[P[Q[J]]]) * (P[Q[J]] - a[P[Q[J]]]),
            b[a[P[Q[J]]]] = b[P[Q[J]]], a[b[P[Q[J]]]] = a[P[Q[J]]] : P[Q[J]];
             P[Q[J]] <= d[k]; k = a[k])
          if (--e[k] < p)
            y -= (b[d[k]] - d[k]) * (k - a[k]), e[k] += c[d[k] = b[d[k]]];
    for (; I <= o && O[Q[I]] == i; I++)
      for (k = !--C[P[Q[I]]]
           ? z -= (D[B[P[Q[I]]]] - D[P[Q[I]]]) * (P[Q[I]] - A[P[Q[I]]]),
          B[A[P[Q[I]]]] = B[P[Q[I]]], A[B[P[Q[I]]]] = A[P[Q[I]]] : P[Q[I]];
           P[Q[I]] <= D[k]; k = A[k])
        if (--E[k] < p)
          z -= (B[D[k]] - D[k]) * (k - A[k]), E[k] += C[D[k] = B[D[k]]];
  }
  return 0 * printf("%I64d\n", x);
}
