#include <bits/stdc++.h>
const int N = 3005;
int n, m, t, k, g[N], l[N], r[N], to[N], v[N], hd[N];
struct E {
  int v, nxt;
} e[N];
long long ans;
int main() {
  scanf("%d%d%d%d", &n, &m, &t, &k);
  for (int i = 1, x, y; i <= t; i++) {
    scanf("%d%d", &x, &y);
    e[i] = (E){y, hd[x]};
    hd[x] = i;
  }
  for (int L = 1; L <= n; L++) {
    for (int R = L; R <= n; R++)
      for (int i = hd[R]; i; i = e[i].nxt) g[e[i].v]++;
    int j = 0, t = 0;
    for (int i = 1; i <= m; i++)
      if (g[i]) l[i] = j, r[j] = i, j = i;
    l[m + 1] = j;
    r[j] = m + 1;
    for (int i = r[0], s = 0, x = 0; i <= m; i = r[i]) {
      for (; x <= m && s < k; x = r[x], s += g[x])
        ;
      t += (i - l[i]) * (m - x + 1);
      to[i] = x;
      v[i] = s;
      s -= g[i];
    }
    if (to[r[0]] > m) break;
    for (int R = n; R >= L; R--) {
      ans += t;
      for (int i = hd[R]; i; i = e[i].nxt) {
        int x = e[i].v, s = 0, j = x;
        g[x]--;
        for (; j && s + g[l[j]] < k; j = l[j], s += g[j])
          ;
        for (; j <= x; j = r[j])
          if (--v[j] < k && to[j] <= m)
            t -= (r[to[j]] - to[j]) * (j - l[j]), to[j] = r[to[j]],
                                                  v[j] += g[to[j]];
        if (!g[x]) r[l[x]] = r[x], l[r[x]] = l[x];
      }
    }
  }
  printf("%lld\n", ans);
  return 0;
}
