#include <bits/stdc++.h>
using namespace std;
long long ans;
struct Poi {
  int x, y;
} a[3010];
int qh[3010][3010], n, m, r, c, v[3010], R[3010];
int pr[3010], nx[3010], er[3010], el[3010], ey[3010], nm[3010];
int is[3010][3010], fa[3010], sz[3010], q[3010][3010], lw[3010];
inline int Cal0(int x) { return (x * (x + 1) / 2); }
inline int Get(int x) {
  if (x == fa[x]) return (x);
  return (fa[x] = Get(fa[x]));
}
inline void Work0() {
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j <= c; j++) q[j][0] = 0;
    for (int j = 1; j <= n; j++)
      if (a[j].x <= i) q[a[j].y][++q[a[j].y][0]] = a[j].x;
    for (int j = 1; j <= c; j++) lw[j] = (q[j][0]) ? (q[j][1]) : (0);
    nx[0] = 1, pr[c + 1] = c;
    for (int j = 1; j <= c; j++) nx[j] = j + 1, pr[j] = j - 1;
    memset(v, 0, sizeof(v));
    for (int j = 0; j <= i; j++) is[j][0] = 0;
    for (int j = 1; j <= c; j++) fa[j] = j, sz[j] = 1;
    for (int j = 1; j <= c; j++) is[lw[j]][++is[lw[j]][0]] = j;
    long long sm = 0;
    for (int j = 0; j < i; j++) {
      for (int k = 1; k <= is[j][0]; k++) {
        int y = is[j][k], fx = 0;
        v[y] = 1, sm += Cal0(sz[y]);
        if (y - 1 > 0 && v[y - 1]) {
          fx = Get(y - 1);
          sm -= Cal0(sz[fx]), sm -= Cal0(sz[y]);
          sz[y] += sz[fx], fa[fx] = fa[y];
          sm += Cal0(sz[y]);
        }
        if (y + 1 <= c && v[y + 1]) {
          fx = Get(y + 1);
          sm -= Cal0(sz[y]), sm -= Cal0(sz[fx]);
          sz[fx] += sz[y], fa[y] = fa[fx];
          sm += Cal0(sz[fx]);
        }
      }
      ans -= sm;
    }
  }
}
inline int Cal(int x) {
  if (!x || x > c) return (0);
  return (R[x] - x) * (x - pr[x]);
}
bool Cmpy(Poi a, Poi b) { return (a.y < b.y || a.y == b.y && a.x > b.x); }
int main() {
  scanf("%d%d%d%d", &r, &c, &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d%d", &a[i].x, &a[i].y);
  sort(a + 1, a + 1 + n, Cmpy);
  for (int i = 1; i <= n; i++) qh[a[i].x][++qh[a[i].x][0]] = a[i].y;
  for (int i = 1; i <= r; i++)
    for (int j = 1; j <= c; j++) ans += (r - i + 1) * 1ll * (c - j + 1);
  Work0();
  if (m == 1) {
    printf("%I64d\n", ans);
    return (0);
  }
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j <= n; j++)
      if (a[j].x <= i) ey[a[j].y] = max(ey[a[j].y], a[j].x);
    for (int j = 1; j <= c; j++) el[j] = j - 1, er[j] = j + 1;
    for (int j = 1; j <= c; j++)
      while (ey[el[j]] < ey[j] && el[j]) el[j] = el[el[j]];
    for (int j = c; j >= 1; j--)
      while (ey[er[j]] <= ey[j] && er[j] <= c) er[j] = er[er[j]];
    memset(v, 0, sizeof(v));
    memset(nm, 0, sizeof(nm));
    memset(nx, 0, sizeof(nx)), nx[0] = c + 1;
    memset(pr, 0, sizeof(pr)), pr[c + 1] = 0;
    long long sm = 0;
    R[0] = R[c + 1] = c + 1;
    for (int j = i; j >= 1; j--) {
      for (int k = 1; k <= qh[j][0]; k++) {
        int y = qh[j][k];
        if (!v[y]) {
          nx[el[y]] = y, pr[y] = el[y];
          sm -= Cal(er[y]);
          pr[er[y]] = y, nx[y] = er[y];
          R[y] = R[nx[y]], nm[y] = nm[nx[y]];
          sm += Cal(y), sm += Cal(nx[y]);
        }
        v[y]++;
        for (int b = y; b && y < R[b]; b = pr[b]) {
          nm[b]++;
          while (nm[b] >= m) {
            sm -= (R[b] - b) * (b - pr[b]);
            nm[b] -= v[pr[R[b]]];
            R[b] = pr[R[b]];
            sm += (R[b] - b) * (b - pr[b]);
          }
        }
      }
      ans -= sm;
    }
  }
  printf("%I64d\n", ans);
}
