#include <bits/stdc++.h>
using namespace std;
void getint(int &v) {
  char ch, fu = 0;
  for (ch = '*'; (ch < '0' || ch > '9') && ch != '-'; ch = getchar())
    ;
  if (ch == '-') fu = 1, ch = getchar();
  for (v = 0; ch >= '0' && ch <= '9'; ch = getchar()) v = v * 10 + ch - '0';
  if (fu) v = -v;
}
vector<int> v[3010];
long long ans, ANS;
int K, n, m, r, p[3010][3010], s[500010], x[500010], y[500010], f[500010],
    L[500010], R[500010], Le[3010][3010], Ri[3010][3010];
void addall() {
  int t = 0;
  for (int i = 1; i <= m + 1; ++i) {
    L[i] = t;
    if (s[i]) t = i;
  }
  t = m + 1;
  for (int i = m; i >= 0; --i) {
    R[i] = t;
    if (s[i]) t = i;
  }
}
void del(int x) {
  --s[x];
  if (!s[x]) {
    R[L[x]] = R[x];
    L[R[x]] = L[x];
  }
}
void init() {
  for (int i = 1; i <= m; ++i) L[i] = 0, R[i] = m + 1;
  R[0] = m + 1, L[m + 1] = 0;
}
void upd(int x, int y) {
  ans -= (x - L[x]) * (m - f[x] + 1);
  f[x] = y;
  ans += (x - L[x]) * (m - f[x] + 1);
}
int gt(int A, int B, int C, int D) {
  return p[B][D] - p[A - 1][D] - p[B][C - 1] + p[A - 1][C - 1];
}
int main() {
  cin >> r >> m >> n >> K;
  for (int i = 1; i <= n; ++i)
    getint(x[i]), getint(y[i]), v[x[i]].push_back(y[i]), ++p[x[i]][y[i]];
  for (int i = 1; i <= r; ++i)
    for (int j = 1; j <= m; ++j)
      p[i][j] += p[i - 1][j] + p[i][j - 1] - p[i - 1][j - 1];
  for (int i = 1; i <= r; ++i) sort(v[i].begin(), v[i].end());
  for (int i = 1; i <= r; ++i) {
    for (int j = 1; j <= m; ++j) s[j] = 0;
    for (int j = i; j <= r; ++j) {
      for (int k = 0; k < v[j].size(); ++k) {
        int t = v[j][k];
        ++s[t];
      }
    }
    addall();
    for (int j = r; j >= i; --j) {
      for (int k = (int)v[j].size() - 1; k >= 0; --k) {
        int t = v[j][k];
        del(t);
        Le[j][t] = L[t];
        Ri[j][t] = R[t];
      }
    }
    init();
    for (int j = 0; j <= m + 1; ++j) f[j] = m + 1;
    ans = 0;
    for (int j = i; j <= r; ++j) {
      for (int k = 0; k < v[j].size(); ++k) {
        int t = v[j][k];
        ++s[t];
        L[t] = Le[j][t];
        R[t] = Ri[j][t];
        R[L[t]] = t;
        L[R[t]] = t;
        int now = t;
        if (s[t] == 1) f[t] = f[R[t]];
        int tt = 0;
        while (now && tt < K) {
          while (gt(i, j, now, L[f[now]]) >= K) upd(now, L[f[now]]);
          now = L[now];
          ++tt;
        }
      }
      ANS += ans;
    }
  }
  cout << ANS << endl;
  return 0;
}
