#include <bits/stdc++.h>
using namespace std;
inline int read() {
  static int x, f;
  static char c;
  x = 0, f = 1, c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
  return x * f;
}
const int N = 3005;
int r, c, n, k, px[N], py[N], node[N];
vector<int> pp[N];
long long ans;
int Nxt[N], Lst[N], pos[N], vr[N], L[N], R[N], He, La, cntv;
long long sum;
vector<int> q[N];
inline void upda(int i) {
  if (i && L[i] <= R[i] && vr[i] <= c)
    sum += (R[i] - L[i] + 1) * (c - vr[i] + 1);
}
inline void decaa(int i) {
  if (i && L[i] <= R[i] && vr[i] <= c)
    sum -= (R[i] - L[i] + 1) * (c - vr[i] + 1);
}
inline void Del(int x) {
  if (x == He) {
    int p, t, y = Nxt[x];
    if (!y) {
      decaa(x);
      He = La = sum = 0;
      return;
    }
    decaa(y), L[y] = 1;
    if (pos[x] == pos[y]) {
      for (p = y, t = 1; t < k; ++t) p = Nxt[p];
      vr[y] = p ? pos[p] : (c + 1);
    }
    upda(y);
    decaa(x);
    He = y, Nxt[x] = Lst[y] = 0;
    return;
  }
  if (x == La) {
    if (!Lst[x]) {
      decaa(x);
      He = La = sum = 0;
      return;
    }
    int y, t;
    for (y = x, t = 1; t < k && y; ++t) {
      y = Lst[y];
      if (!y) break;
      decaa(y), vr[y] = c + 1, upda(y);
    }
    decaa(x), y = Lst[x], Lst[x] = Nxt[y] = 0, La = y;
    return;
  }
  int y, z, t, p, w;
  y = Nxt[x];
  decaa(y), L[y] = L[x];
  if (pos[x] == pos[y]) {
    for (p = y, t = 1; t < k; ++t) p = Nxt[p];
    vr[y] = p ? pos[p] : (c + 1);
  }
  upda(y);
  z = vr[x];
  for (y = x, t = 1; t < k && y; ++t) {
    y = Lst[y];
    if (!y) break;
    decaa(y);
    w = vr[y], vr[y] = z, z = w;
    upda(y);
  }
  decaa(x), y = Lst[x], z = Nxt[x];
  Lst[x] = Nxt[x] = 0, Nxt[y] = z, Lst[z] = y;
  return;
}
inline void solve(int r) {
  int i, j, t, p, id;
  cntv = He = La = 0;
  sum = 0;
  for (i = 1; i <= n; ++i)
    node[i] = Nxt[i] = Lst[i] = pos[i] = L[i] = R[i] = vr[i] = 0;
  for (i = 1; i <= n; ++i)
    if (px[i] <= r) q[py[i]].push_back(i);
  for (i = 1; i <= c; ++i)
    for (j = 0; j < q[i].size(); ++j) {
      id = q[i][j];
      if (!He) {
        node[id] = He = La = cntv = 1, pos[1] = py[id];
      } else {
        node[id] = ++cntv;
        pos[cntv] = py[id];
        Nxt[La] = cntv, Lst[cntv] = La, La = cntv;
      }
    }
  for (i = He, j = 0; i; i = Nxt[i]) {
    L[i] = j + 1, R[i] = pos[i], j = pos[i];
    for (p = i, t = 1; t < k; ++t) p = Nxt[p];
    if (!p)
      vr[i] = c + 1;
    else
      vr[i] = pos[p];
    upda(i);
  }
  for (i = 1; i <= r; ++i) {
    ans += sum;
    for (j = 0; j < pp[i].size(); ++j) Del(node[pp[i][j]]);
  }
  for (i = 1; i <= n; ++i) q[py[i]].clear();
}
int main() {
  int i, j;
  r = read(), c = read(), n = read(), k = read();
  for (i = 1; i <= n; ++i)
    px[i] = read(), py[i] = read(), pp[px[i]].push_back(i);
  for (i = 1; i <= r; ++i) solve(i);
  cout << ans << '\n';
  return 0;
}
