#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 10;
const long long MN = 3e3 + 10;
long long Cur, ans;
vector<long long> R[MN], Now;
long long n, m, L, k;
long long prv[MN], nxt[MN], sv[MN], num[MN], val[MN];
long long fin, beg;
long long Tmp[33], sz;
void Make_List() {
  beg = INF, fin = -INF, Cur = 0;
  memset(val, 0, sizeof val), memset(prv, -1, sizeof prv),
      memset(nxt, -1, sizeof nxt);
  long long p = 0, cur_sm = 0;
  for (long long i = 0; i < ((long long)(Now).size()); ++i) {
    while (p < ((long long)(Now).size()) && cur_sm + num[Now[p]] < k) {
      cur_sm += num[Now[p]];
      ++p;
    }
    if (p != ((long long)(Now).size())) {
      long long tg = Now[i] + 1;
      if (i) tg = Now[i] - Now[i - 1];
      val[Now[i]] = 1ll * (n - Now[p]) * tg;
      Cur += val[Now[i]];
    }
    if (i) prv[Now[i]] = Now[i - 1];
    if (((long long)(Now).size()) - i - 1) nxt[Now[i]] = Now[i + 1];
    cur_sm -= num[Now[i]];
    beg = min(beg, Now[i]), fin = max(fin, Now[i]);
  }
}
void Erase(long long x) {
  sz = 0;
  long long cur = x, cnt = k + 1;
  while (~cur && cnt--) {
    Tmp[sz++] = cur;
    cur = prv[cur];
  }
  reverse(Tmp, Tmp + sz);
  cur = nxt[x], cnt = k + 2;
  long long lim = max(x, nxt[x]);
  while (~cur && cnt--) {
    Tmp[sz++] = cur;
    cur = nxt[cur];
  }
  --num[x];
  if (num[x] == 0) {
    if (~prv[x]) nxt[prv[x]] = nxt[x];
    if (~nxt[x]) prv[nxt[x]] = prv[x];
    nxt[x] = prv[x] = -1;
  }
  long long p = 0, cur_sm = 0;
  for (long long i = 0; i < sz && Tmp[i] <= lim; ++i) {
    while (p < sz && cur_sm + num[Tmp[p]] < k) {
      cur_sm += num[Tmp[p]];
      ++p;
    }
    Cur -= val[Tmp[i]];
    if (p == sz || num[Tmp[i]] == 0)
      val[Tmp[i]] = 0;
    else {
      long long t_ = prv[Tmp[i]], tg = 0;
      if (t_ == -1)
        tg = Tmp[i] + 1;
      else
        tg = Tmp[i] - t_;
      val[Tmp[i]] = 1ll * (n - Tmp[p]) * tg;
    }
    Cur += val[Tmp[i]];
    cur_sm -= num[Tmp[i]];
  }
}
int32_t main() {
  ios_base ::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> m >> n >> L >> k;
  while (L--) {
    long long r, c;
    cin >> r >> c;
    --r, --c;
    R[r].push_back(c);
  }
  for (long long i = m - 1; ~i; --i) {
    for (auto x : R[i]) Now.push_back(x), ++num[x];
    for (long long i = 0; i < n; ++i) sv[i] = num[i];
    sort(Now.begin(), Now.end());
    Now.resize(unique(Now.begin(), Now.end()) - Now.begin());
    Make_List();
    for (long long j = m - 1; j >= i; --j) {
      ans += Cur;
      for (auto x : R[j]) Erase(x);
    }
    for (long long i = 0; i < n; ++i) num[i] = sv[i];
  }
  cout << ans << endl;
  return 0;
}
