#include <bits/stdc++.h>
using namespace std;
const long long linf = 1e18 + 5;
const int mod = (int)1e9 + 7;
const int logN = 17;
const int inf = 1e9;
const int N = 3e3 + 5;
int C[N], H[N], r, c, n, k, x, y, t, asd[N], dasd[N];
vector<int> v[N];
vector<pair<int, int> > all;
long long ans, cur;
long long bef(int x) { return x - dasd[x]; }
long long aft(int x) { return asd[x] - x; }
long long CC(int x) { return (long long)(x) * (x - 1) / 2; }
int pp[N];
void doit(int x, int mul) {
  int c0 = H[x], s = 0;
  pp[++s] = x;
  int xx = x;
  while (!C[dasd[x]] && dasd[x] && H[dasd[x]] + c0 <= k) {
    c0 += H[dasd[x]];
    x = dasd[x];
    pp[++s] = x;
  }
  int t = xx;
  while (s) {
    while (!C[asd[t]] && c0 + H[asd[t]] <= k && t != r + 1) {
      c0 += H[asd[t]];
      t = asd[t];
    }
    if (c0 <= k) cur += mul * (asd[t] - xx) * bef(pp[s]);
    c0 -= H[pp[s--]];
  }
}
int main() {
  scanf("%d %d %d %d", &r, &c, &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &x, &y);
    all.push_back(make_pair(x, y));
    v[y].push_back(x);
  }
  --k;
  for (int i = 1; i <= c; i++) {
    memset(H, 0, sizeof H);
    for (__typeof(all.begin()) it = all.begin(); it != all.end(); it++)
      if (it->second <= i) {
        H[it->first]++;
      }
    memset(asd, -1, sizeof asd);
    memset(dasd, -1, sizeof dasd);
    int last = 0;
    cur = 0;
    for (int j = 1; j <= r; j++) {
      if (H[j]) {
        cur += CC(j - last);
        dasd[j] = last;
        asd[last] = j;
        last = j;
      }
    }
    asd[last] = r + 1;
    cur += CC(r - last + 1);
    dasd[r + 1] = last;
    asd[r + 1] = r + 1;
    int cc = 0, c0 = 0, tt = asd[0];
    while (tt != r + 1) {
      while (cc != r + 1 && c0 + H[asd[cc]] <= k) {
        c0 += H[asd[cc]];
        cc = asd[cc];
      }
      if (c0 <= k) cur += bef(tt) * (asd[cc] - tt);
      c0 -= H[tt];
      tt = asd[tt];
    }
    for (int j = 1; j <= i; j++) {
      ans += cur;
      for (__typeof(v[j].begin()) it = v[j].begin(); it != v[j].end(); it++) {
        doit(*it, -1);
        C[*it] = 1;
        H[*it]--;
      }
      for (__typeof(v[j].begin()) it = v[j].begin(); it != v[j].end(); it++) {
        doit(*it, +1);
        C[*it] = 0;
        if (!H[*it]) {
          int pr = dasd[*it];
          int nx = asd[*it];
          dasd[nx] = pr;
          asd[pr] = nx;
        }
      }
    }
  }
  printf("%lld\n", CC(r + 1) * CC(c + 1) - ans);
  return 0;
}
