#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1.01e9;
const double eps = 1e-9;
const int N = 3010;
pair<int, int> a[N];
set<int> second;
int d[N];
int R[N];
int L[N];
int to[N];
int cnt[N];
long long val = 0;
int c, k;
inline int f(int y) {
  if (cnt[y] >= k) return (c - to[y]) * (y - L[y]);
  return 0;
}
void upd(int y) {
  if (d[y] == 0) {
    set<int>::iterator it = second.lower_bound(y);
    to[y] = y;
    if (it != second.end()) {
      R[y] = *it;
      int z = R[y];
      while (z < c && cnt[y] < k) {
        cnt[y] += d[z];
        if (cnt[y] >= k) break;
        z = R[z];
      }
      to[y] = z;
    }
    if (it != second.begin()) {
      --it;
      L[y] = *it;
      R[L[y]] = y;
      int z = L[y];
      while (z >= 0) {
        if (cnt[z] >= k) break;
        to[z] = max(to[z], y);
        z = L[z];
      }
    }
    val += f(y);
    if (R[y] < c) {
      val -= f(R[y]);
      L[R[y]] = y;
      val += f(R[y]);
    }
    L[R[y]] = y;
    if (to[y] == c) to[y] = L[c];
    second.insert(y);
  }
  d[y]++;
  int z = y;
  while (z >= 0) {
    if (to[z] < y) break;
    val -= f(z);
    cnt[z] += 1;
    val += f(z);
    if (to[z] < c) {
      if (cnt[z] - d[to[z]] >= k) {
        val -= f(z);
        cnt[z] -= d[to[z]];
        to[z] = L[to[z]];
        val += f(z);
      }
    }
    z = L[z];
  }
}
int main() {
  int r, n;
  scanf("%d%d%d%d", &r, &c, &n, &k);
  for (int i = 0; (i) < (n); ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    --x, --y;
    a[i] = make_pair(x, y);
  }
  sort(a, a + n);
  long long res = 0;
  for (int rst = 0; rst < r; ++rst) {
    int pos = 0;
    while (pos < n && a[pos].first < rst) pos++;
    val = 0;
    second.clear();
    for (int i = 0; (i) < (c + 1); ++i) R[i] = c;
    for (int i = 0; (i) < (c + 1); ++i) L[i] = -1;
    for (int i = 0; (i) < (c); ++i) d[i] = 0, to[i] = 0, cnt[i] = 0;
    for (int ren = rst; ren < r; ++ren) {
      while (pos < n && a[pos].first == ren) {
        upd(a[pos].second);
        pos++;
      }
      res += val;
    }
  }
  printf("%I64d\n", res);
  return 0;
}
