#include <bits/stdc++.h>
const int MAX_N = (int)1e5 + 123;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;
using namespace std;
int r, c, n, k;
vector<int> row[3005];
long long ans;
int pref[3005];
struct List {
  int l, r, cnt;
  List() : l(-1), r(-1), cnt(0) {}
  List(int l, int r, int cnt) : l(l), r(r), cnt(cnt) {}
} a[3005];
inline void init(int &res) {
  pref[0] = 0;
  for (int i = 1; i <= c; i++) pref[i] = pref[i - 1] + a[i].cnt;
  for (int i = 1, j = 1, all = 0; i <= c; i++) {
    while (j <= c && pref[j] - pref[i - 1] < k) j++;
    res += (c - j + 1);
  }
  for (int i = 1, last = 0; i <= c; i++) {
    if (a[i].cnt) {
      a[i].l = last;
      last = i;
    }
  }
  for (int i = c, last = c + 1; i > 0; i--)
    if (a[i].cnt) {
      a[i].r = last;
      last = i;
    }
}
vector<pair<int, int> > L, R;
inline void del(int &res, int y) {
  int it = y;
  L.clear(), R.clear();
  while (int((L).size()) < k) {
    if (it == 0) break;
    L.push_back(make_pair(it, a[it].cnt));
    if (int((L).size()) > 1) L.back().second += L[int((L).size()) - 2].second;
    it = a[it].l;
  }
  reverse(L.begin(), L.end());
  it = y;
  while (int((R).size()) < k) {
    if (it == c + 1) break;
    R.push_back(make_pair(it, a[it].cnt));
    if (int((R).size()) > 1) R.back().second += R[int((R).size()) - 2].second;
    it = a[it].r;
  }
  for (int i = 0, j = 0; i < int((L).size()); i++) {
    while (j < int((R).size()) && L[i].second + R[j].second - a[y].cnt < k) j++;
    if (j < int((R).size()) && L[i].second + R[j].second - a[y].cnt == k)
      res -= (L[i].first - a[L[i].first].l) * (a[R[j].first].r - R[j].first);
  }
  a[y].cnt--;
  if (!a[y].cnt) {
    int rr = a[y].r;
    a[a[y].l].r = a[y].r;
    a[rr].l = a[y].l;
  }
}
int main() {
  scanf("%d%d%d%d", &r, &c, &n, &k);
  for (int i = 1, x, y; i <= n; i++) {
    scanf("%d%d", &x, &y);
    row[x].push_back(y);
  }
  long long pref = 0;
  for (int i = 1, now; i <= r; i++) {
    if (i > 1 && row[i - 1].empty()) {
      ans += pref;
      continue;
    }
    for (int j = 1; j <= c; j++) a[i] = List();
    for (int j = i; j <= r; j++)
      for (auto it : row[j]) a[it].cnt++;
    now = 0;
    pref = 0;
    init(now);
    for (int j = r; j >= i; j--) {
      ans += now;
      pref += now;
      for (auto it : row[j]) del(now, it);
    }
  }
  printf("%lld", ans);
  return 0;
}
