#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const long long oo = 1e18;
const int N = 4001;
int n, m, q, k;
pair<int, int> p[N];
vector<int> col[N];
list<int> pos;
list<int>::iterator bk[N], far[N];
long long ans = 0;
void proc(int cr) {
  int j = cr;
  pos.clear();
  long long cur = 0;
  for (int i = 0; i <= k; ++i) pos.push_back(0);
  for (int i = 1; i <= q; ++i)
    if (p[i].second >= cr) {
      pos.push_back(i);
      bk[i] = --pos.end();
    }
  for (int i = 0; i <= k; ++i) pos.push_back(q + 1);
  for (auto i : pos) {
    if (i == 0 || i == q + 1) continue;
    far[i] = bk[i];
    for (int j = 0; j < k - 1; ++j) far[i]++;
    cur += (p[i].first - p[*prev(bk[i])].first) * (n + 1 - p[*far[i]].first);
  }
  for (int j = m; j >= cr; --j) {
    ans += cur;
    for (auto v : col[j]) {
      cur -= (p[v].first - p[*prev(bk[v])].first) *
             (p[*next(far[v])].first - p[*far[v]].first);
      auto it = bk[v];
      for (int j = 0; j < k - 1; ++j) {
        --it;
        if (*it == 0) break;
        cur -= (p[*it].first - p[*prev(it)].first) *
               (p[*next(far[*it])].first - p[*far[*it]].first);
        far[*it]++;
      }
      pos.erase(bk[v]);
    }
  }
}
int main() {
  cin >> n >> m >> q >> k;
  for (int i = 1; i <= q; ++i) scanf("%d%d", &p[i].first, &p[i].second);
  sort(p + 1, p + q + 1);
  p[q + 1] = make_pair(n + 1, m + 1);
  for (int i = 1; i <= q; ++i) col[p[i].second].push_back(i);
  for (int i = 1; i <= m; ++i) proc(i);
  cout << ans << endl;
  return 0;
}
