#include <bits/stdc++.h>
using namespace std;
const long long MXN = 2e5 + 10;
const long long INF = 1e9;
long long r, c, n, k, now, ans, kol;
long long X[MXN], Y[MXN], nxt[MXN], prv[MXN], Pnt[MXN];
long long A[MXN], Mx[MXN], zero[MXN];
vector<long long> R[MXN], C[MXN];
long long f(long long x) { return x * (x + 1) / 2; }
void Make(long long l, long long r, bool flag) {
  long long pnt = l, ted = A[l];
  if (flag) {
    for (int i = l; i != r; i = nxt[i])
      now -= (zero[i] + 1) * (Mx[i] - i) + f(zero[i]);
  }
  for (int i = l; i != r; i = nxt[i]) {
    while (pnt < i) {
      ted += A[nxt[pnt]];
      pnt = nxt[pnt];
    }
    while (nxt[pnt] != -1 && ted + A[nxt[pnt]] <= k) {
      ted += A[nxt[pnt]];
      pnt = nxt[pnt];
    }
    Mx[i] = (ted <= k ? nxt[pnt] : pnt);
    now += (zero[i] + 1) * (Mx[i] - i) + f(zero[i]);
    ted -= A[i];
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> r >> c >> n >> k;
  k--;
  for (int i = 1; i <= n; i++) {
    long long x, y;
    cin >> x >> y;
    X[i] = x, Y[i] = y;
    R[x].push_back(i), C[y].push_back(i);
  }
  for (int a = 1; a <= r; a++) {
    sort(R[a].begin(), R[a].end(),
         [&](const int& i, const int& j) { return Y[i] < Y[j]; });
  }
  for (int b = 1; b <= c; b++) {
    sort(C[b].begin(), C[b].end(),
         [&](const int& i, const int& j) { return X[i] < X[j]; });
  }
  for (int up = 1; up <= r; up++) {
    A[c + 1] = INF;
    for (int i = 1; i <= c; i++) {
      while (Pnt[i] < int(C[i].size()) && X[C[i][Pnt[i]]] < up) Pnt[i]++;
      A[i] = int(C[i].size()) - Pnt[i];
      zero[i] = (i > 1 && A[i - 1] == 0 ? zero[i - 1] + 1 : 0);
    }
    long long last = -1, bgn = c + 1, fns = c + 1;
    for (int i = 1; i <= c + 1; i++) {
      if (A[i] == 0) continue;
      if (last != -1)
        nxt[last] = i;
      else
        bgn = i;
      prv[i] = last;
      last = i;
    }
    if (last != -1) nxt[last] = -1;
    now = 0, Make(bgn, fns, 0), Mx[c + 1] = c + 1;
    zero[c + 1] = (A[c] == 0 ? zero[c] + 1 : 0);
    now += f(zero[c + 1]);
    for (int dn = r; dn >= up; dn--) {
      ans += now;
      for (auto id : R[dn]) {
        long long p = Y[id];
        A[p]--;
        long long ten = k, idx = p;
        while (prv[idx] != -1 && ten) {
          idx = prv[idx], ten--;
        }
        if (A[p] > 0)
          Make(idx, nxt[p], 1);
        else {
          ten = nxt[p];
          now -= (zero[p] + 1) * (Mx[p] - p) + f(zero[p]);
          now -= (zero[ten] + 1) * (Mx[ten] - ten) + f(zero[ten]);
          zero[ten] += zero[p] + 1;
          now += (zero[ten] + 1) * (Mx[ten] - ten) + f(zero[ten]);
          if (prv[p] != -1) nxt[prv[p]] = ten;
          prv[ten] = prv[p];
          if (idx != p) Make(idx, ten, 1);
        }
      }
    }
  }
  kol = 1ll * c * r * (c + 1) * (r + 1) / 4;
  ans = kol - ans;
  cout << ans << '\n';
  return 0;
}
