#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
function<void(void)> ____ = []() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
};
const int MAXN = 3e3 + 7;
int n, m, k, p, L[MAXN], R[MAXN], cnt[MAXN];
vector<int> vec[MAXN];
void solve() {
  scanf("%d %d %d %d", &n, &m, &p, &k);
  for (int i = 1; i <= p; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    vec[x].push_back(y);
  }
  for (int i = 1; i <= n; i++) sort(vec[i].begin(), vec[i].end());
  long long ret = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++)
      for (int x : vec[j]) cnt[x]++;
    int lst = 0;
    for (int j = 1; j <= m; j++)
      if (cnt[j]) R[lst] = j, L[j] = lst, lst = j;
    R[lst] = m + 1;
    int tot = 0;
    for (int r = 0, l = 0, s = 0; r <= m; s += cnt[r = R[r]]) {
      while (s - cnt[l] >= k) s -= cnt[l], l = R[l];
      if (s >= k) tot += l * (R[r] - r);
    }
    for (int j = n; j >= i; j--) {
      ret += tot;
      for (int x : vec[j]) {
        int lp = x, s = cnt[lp];
        while (L[lp] and s < k) s += cnt[lp = L[lp]];
        for (int rp = x; rp <= m; s += cnt[rp = R[rp]]) {
          while (s > k) s -= cnt[lp], lp = R[lp];
          if (lp > x) break;
          if (s == k) tot -= (lp - L[lp]) * (R[rp] - rp);
        }
        cnt[x]--;
        if (!cnt[x]) {
          R[L[x]] = R[x];
          L[R[x]] = L[x];
        }
      }
    }
  }
  cout << ret << endl;
}
int main() {
  solve();
  return 0;
}
