#include <bits/stdc++.h>
using namespace std;
const long long N = 3100;
long long r, c, n, k, pos[N], sz[N], sum[N], pre[N], suc[N], len[N];
long long t[N], all, ans;
vector<long long> p[N];
inline long long read() {
  long long f = 1, x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 + s - '0';
    s = getchar();
  }
  return x * f;
}
inline void del(long long x) {
  suc[pre[x]] = suc[x];
  pre[suc[x]] = pre[x];
}
inline long long cal(long long x) {
  if (x == c + 1) return len[x] * (len[x] - 1) / 2;
  long long r = (pos[x] == c + 1) ? c : (suc[pos[x]] - 1);
  return (2 * (r - x) + len[x] + 1) * len[x] / 2;
}
inline void upd(long long x) {
  sz[x]--;
  long long now = x;
  if (pos[x] >= x && pos[x] != c + 1) {
    sum[x]--;
    all -= cal(x);
    if (sz[suc[pos[x]]] + sum[x] < k)
      pos[x] = suc[pos[x]], sum[x] += sz[pos[x]];
    all += cal(x);
  } else if (pos[x] < x && sz[x] < k)
    all -= cal(x), pos[x] = x, sum[x] = sz[x], all += cal(x);
  if (!sz[x]) {
    all -= cal(x) + cal(suc[x]);
    len[suc[x]] += len[x];
    all += cal(suc[x]);
  }
  x = pre[x];
  while (x) {
    if (pos[x] >= now) {
      if (pos[x] != c + 1) {
        sum[x]--;
        all -= cal(x);
        if (sz[suc[pos[x]]] + sum[x] < k)
          pos[x] = suc[pos[x]], sum[x] += sz[pos[x]];
        all += cal(x);
        if (pos[x] == now && !sz[now]) pos[x] = pre[now];
      }
    } else if (pos[x] == pre[now] && sum[x] + sz[now] < k) {
      all -= cal(x);
      pos[x] = now, sum[x] += sz[now];
      all += cal(x);
      if (!sz[now]) pos[x] = pre[now];
    } else
      break;
    x = pre[x];
  }
  if (!sz[now]) del(now);
}
signed main() {
  r = read();
  c = read();
  n = read();
  k = read();
  for (long long i = 1; i <= n; i++) {
    long long x = read(), y = read();
    p[x].push_back(y);
    t[y]++;
  }
  t[c + 1] = 1;
  for (long long i = 1; i <= r; i++) {
    long long last = 0;
    for (long long j = 1; j <= c + 1; j++)
      if (t[j]) {
        pre[j] = last;
        suc[last] = j;
        len[j] = j - last;
        sz[j] = t[j];
        last = j;
      }
    if (pre[c + 1] == 0) {
      ans += (r - i + 1) * c * (c + 1) / 2;
      continue;
    }
    sz[c + 1] = 0;
    pos[c + 1] = c + 1;
    sum[c + 1] = 0;
    all = len[c + 1] * (len[c + 1] - 1) / 2;
    for (long long j = pre[c + 1]; j; j = pre[j]) {
      pos[j] = pos[suc[j]];
      sum[j] = sum[suc[j]] + sz[j];
      while (sum[j] >= k) sum[j] -= sz[pos[j]], pos[j] = pre[pos[j]];
      all += cal(j);
    }
    ans += all;
    for (long long j = r; j > i; j--) {
      for (long long x : p[j]) upd(x);
      ans += all;
    }
    for (long long x : p[i]) t[x]--;
  }
  long long tmp = 0;
  for (long long i = 1; i <= r; i++)
    for (long long j = 1; j <= c; j++) tmp += (r - i + 1) * (c - j + 1);
  ans = tmp - ans;
  printf("%lld\n", ans);
}
