#include <bits/stdc++.h>
using namespace std;
int r, c, n, k;
int x[3010], y[3010];
vector<int> G[3010];
int cnt[3010];
int pre[3010], nxt[3010];
int pr[3010], nx[3010];
void add(int x, int v) {
  for (int i = x; i <= c; i += i & -i) pr[i] = max(pr[i], v);
  for (int i = x; i; i -= i & -i) nx[i] = min(nx[i], v);
}
int getpre(int x) {
  int res = 0;
  for (int i = x; i; i -= i & -i) res = max(res, pr[i]);
  return res;
}
int getnxt(int x) {
  int res = c + 1;
  for (int i = x; i <= c; i += i & -i) res = min(res, nx[i]);
  return res;
}
int q1[20], q2[20], t1, t2;
long long ans;
int res;
void solve(int x) {
  if (!cnt[x]) {
    int l = getpre(x), r = getnxt(x);
    nxt[l] = x;
    pre[x] = l;
    nxt[x] = r;
    pre[r] = x;
    add(x, x);
  }
  cnt[x]++;
  t1 = t2 = 0;
  int t = x, s = 0;
  while (t && s < k) q1[++t1] = t, s += cnt[t], t = pre[t];
  t = x;
  s = 0;
  while (t <= c && s < k) q2[++t2] = t, s += cnt[t], t = nxt[t];
  for (int i = t2, j = 1; i >= 1; i--) {
    while (s < k && j < t1) j++, s += cnt[q1[j]];
    if (s == k) res += (nxt[q2[i]] - q2[i]) * (q1[j] - pre[q1[j]]);
    s -= cnt[q2[i]];
  }
}
int main() {
  scanf("%d%d%d%d", &r, &c, &n, &k);
  for (int i = 1; i <= n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    G[x].push_back(y);
  }
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j <= c; j++)
      cnt[j] = 0, pre[j] = pr[j] = 0, nxt[j] = nx[j] = c + 1;
    res = 0;
    for (int j = i; j <= r; j++) {
      for (int t = 0; t < (int)G[j].size(); t++) solve(G[j][t]);
      ans += res;
    }
  }
  printf("%lld", ans);
  return 0;
}
