#include <bits/stdc++.h>
using namespace std;
namespace zyt {
const int N = 3e3 + 10;
int L[N], R[N], s[N], n, m, t, k, num[N];
long long ans;
pair<int, int> arr[N];
vector<int> g[N];
int work() {
  scanf("%d%d%d%d", &n, &m, &t, &k);
  for (int i = 0; i < t; i++)
    scanf("%d%d", &arr[i].first, &arr[i].second),
        g[arr[i].first].push_back(arr[i].second);
  for (int i = 1; i <= n; i++) sort(g[i].begin(), g[i].end());
  for (int i = 1; i <= n; i++) {
    memset(num, 0, sizeof(int[m + 1]));
    for (int j = i; j <= n; j++)
      for (vector<int>::iterator it = g[j].begin(); it != g[j].end(); it++)
        ++num[*it];
    int last = 0;
    for (int j = 1; j <= m; j++)
      if (num[j]) L[j] = last, R[last] = j, last = j;
    R[last] = m + 1;
    int now = 0;
    for (int l = R[0], r = R[0], tmp = 0; r <= m; r = R[r]) {
      tmp += num[r];
      while (tmp - num[l] >= k) tmp -= num[l], l = R[l];
      if (tmp >= k) now += (R[r] - r) * l;
    }
    for (int j = n; j >= i; j--) {
      ans += now;
      for (vector<int>::iterator it = g[j].begin(); it != g[j].end(); it++) {
        int l = *it, r = *it, tmp = 0;
        while (L[l] && tmp < k) tmp += num[l = L[l]];
        while (r <= m) {
          tmp += num[r];
          while (tmp > k) tmp -= num[l], l = R[l];
          if (l > *it) break;
          if (tmp == k) now -= (R[r] - r) * (l - L[l]);
          r = R[r];
        }
        if (!(--num[*it])) R[L[*it]] = R[*it], L[R[*it]] = L[*it];
      }
    }
  }
  printf("%lld", ans);
  return 0;
}
}  // namespace zyt
int main() { return zyt::work(); }
