#include <bits/stdc++.h>
using namespace std;
int n, m, q, k;
vector<pair<int, int> > c[10010];
vector<tuple<int, int, int> > cells;
int ___next[10010], ___prev[10010], ___right[10010], node[10010], pos[10010];
long long res;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> q >> k;
  --k;
  for (int i = 1; i <= q; ++i) {
    int x, y;
    cin >> x >> y;
    c[x].push_back({y, i});
    cells.push_back({y, x, i});
  }
  cells.push_back({0, n + 1, 0});
  cells.push_back({m + 1, n + 1, q + 1});
  sort(cells.begin(), cells.end());
  res = (1ll * n * (n + 1) / 2) * (1ll * m * (m + 1) / 2);
  for (int u = 1; u <= n; ++u) {
    int sz = 0;
    for (auto [y, x, id] : cells) {
      if (x < u) continue;
      ___next[sz] = sz + 1;
      ___prev[sz] = sz - 1;
      pos[id] = sz;
      node[sz++] = y;
    }
    long long cur = 0;
    for (int i = 0; i < sz && node[i] != m + 1; ++i) {
      if (k >= 0)
        cur += (node[i + 1] - node[i]) * (node[i + 1] - node[i] - 1) / 2;
      for (int j = i + 1; j < sz && j <= i + k && node[j] != m + 1; ++j) {
        cur += (node[j + 1] - node[j]) * (node[i + 1] - node[i]);
      }
    }
    for (int v = n; v >= u; --v) {
      res -= cur;
      for (auto [x, id] : c[v]) {
        int ___left = node[pos[id]] - node[___prev[pos[id]]];
        int ___right = node[___next[pos[id]]] - node[pos[id]];
        if (k == 0) cur += ___left * ___right;
        vector<int> deltaL(k + 10, -1);
        vector<int> deltaR(k + 10, -1);
        for (int i = 1, j = ___next[pos[id]]; i <= k && node[j] != m + 1;
             ++i, j = ___next[j]) {
          deltaR[i] = node[___next[j]] - node[j];
          if (i == k) cur += deltaR[i] * ___left;
        }
        for (int i = 1, j = ___prev[pos[id]]; i <= k && node[j] != 0;
             ++i, j = ___prev[j]) {
          deltaL[i] = node[j] - node[___prev[j]];
          if (i == k) cur += deltaL[i] * ___right;
        }
        for (int i = 1; i <= k; ++i)
          if (deltaL[i] != -1 && deltaR[k - i] != -1)
            cur += deltaL[i] * deltaR[k - i];
        ___next[___prev[pos[id]]] = ___next[pos[id]];
        ___prev[___next[pos[id]]] = ___prev[pos[id]];
      }
    }
  }
  cout << res;
}
