#include <bits/stdc++.h>
using namespace std;
namespace Base {
const int inf = 0x3f3f3f3f, INF = 0x7fffffff;
const long long infll = 0x3f3f3f3f3f3f3f3fll, INFll = 0x7fffffffffffffffll;
template <typename T>
void read(T &x) {
  x = 0;
  int fh = 1;
  double num = 1.0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') fh = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  if (ch == '.') {
    ch = getchar();
    while (isdigit(ch)) {
      num /= 10;
      x = x + num * (ch - '0');
      ch = getchar();
    }
  }
  x = x * fh;
}
template <typename T>
void chmax(T &x, T y) {
  x = x < y ? y : x;
}
template <typename T>
void chmin(T &x, T y) {
  x = x > y ? y : x;
}
}  // namespace Base
using namespace Base;
const int N = 3010;
struct Node {
  int x, y;
} p[N];
int L, C, n, k, cnt[N], nxt[N], pre[N], num[N], les[N], hav[N];
long long ans;
bool cmp(Node x, Node y) { return x.x < y.x || (x.x == y.x && x.y < y.y); }
void recal(int x) {
  num[x] = (x - pre[x] - 1) * (x - pre[x]) / 2;
  int w = (x - pre[x]);
  while (les[x] != C + 1 && hav[x] < k) {
    les[x] = nxt[les[x]];
    hav[x] += cnt[les[x]];
  }
  num[x] = num[x] + w * (les[x] - x);
}
int main() {
  read(L);
  read(C);
  read(n);
  read(k);
  for (int i = 1; i <= n; i++) {
    read(p[i].x);
    read(p[i].y);
  }
  sort(p + 1, p + n + 1, cmp);
  for (int i = 1; i <= L; i++) {
    memset(cnt, 0, sizeof(cnt));
    for (int j = n; j >= 1; j--) {
      if (p[j].x < i) break;
      cnt[p[j].y]++;
    }
    int nt = C + 1;
    for (int j = C; j >= 1; j--)
      if (cnt[j] > 0) nxt[j] = nt, pre[nt] = j, nt = j;
    pre[nt] = 0;
    nxt[0] = nt;
    nxt[C + 1] = C + 2;
    int tot = C * (C + 1) / 2, non = 0;
    for (int j = nxt[0]; j != C + 2; j = nxt[j]) {
      les[j] = j, hav[j] = cnt[j];
      recal(j);
      non = non + num[j];
    }
    ans = ans + tot - non;
    for (int t = L - 1, j = n; t >= i; t--) {
      while (p[j].x > t) {
        --cnt[p[j].y];
        int q = p[j].y, l = cnt[p[j].y];
        while (q != 0 && les[q] >= p[j].y) {
          non = non - num[q];
          hav[q]--;
          recal(q);
          non = non + num[q];
          q = pre[q];
          l = l + cnt[q];
        }
        if (cnt[p[j].y] == 0) {
          nxt[pre[p[j].y]] = nxt[p[j].y];
          pre[nxt[p[j].y]] = pre[p[j].y];
          recal(nxt[p[j].y]);
        }
        j--;
      }
      ans = ans + tot - non;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
