#include <bits/stdc++.h>
using namespace std;
struct O {
  int x, y;
} a[3005];
int f[3005], g[3005], l[3005], r[3005], P, Q, n, K;
long long tmp, ans;
bool cmp(O a, O b) { return a.x == b.x ? a.y < b.y : a.x < b.x; }
int find(int j) {
  int x = g[j];
  while (j && x < K) j = l[j], x += g[j];
  return j;
}
int main() {
  scanf("%d%d%d%d", &P, &Q, &n, &K);
  for (int i = 1; i <= n; ++i) scanf("%d%d", &a[i].x, &a[i].y);
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1, I = 1; i <= P; ++i) {
    while (I <= n && a[I].x < i) ++I;
    for (int j = I; j <= n; ++j) ++g[a[j].y];
    for (int j = 1, x = 0; j < Q + 1; ++j)
      if (g[j])
        l[j] = x, x = j;
      else
        l[j] = 0;
    for (int j = Q, x = Q + 1; ~j; --j)
      if (g[j] || !j)
        r[j] = x, x = j;
      else
        r[j] = 0;
    for (int j = 1; j <= Q; ++j)
      if (g[j]) {
        int x = g[j], k = j;
        while (k && x < K) k = l[k], x += g[k];
        f[j] = k;
        tmp += 1ll * (r[j] - j) * f[j];
      }
    for (int j = P, J = n; j >= i; --j) {
      ans += tmp;
      while (J && a[J].x == j) {
        int t = a[J].y;
        --g[t];
        int x = g[t], p = t;
        while (p && x < K) p = l[p], x += g[p];
        tmp -= 1ll * (r[t] - t) * f[t];
        f[t] = p;
        tmp += 1ll * (r[t] - t) * f[t];
        for (int k = r[t]; k != Q + 1; k = r[k]) {
          x += g[k];
          while (x - g[p] >= K) x -= g[p], p = r[p];
          if (p >= t) break;
          tmp -= 1ll * (r[k] - k) * f[k];
          f[k] = p;
          tmp += 1ll * (r[k] - k) * f[k];
        }
        if (!g[t]) r[l[t]] = r[t], l[r[t]] = l[t];
        --J;
      }
    }
  }
  printf("%lld\n", ans);
  return 0;
}
