#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0;
  bool flg = false;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') flg = true;
  for (; isdigit(ch); ch = getchar()) x = (x << 3) + (x << 1) + (ch ^ 48);
  return flg ? -x : x;
}
int n, m, q, k;
pair<int, int> c[3010];
vector<int> f[3010];
vector<int> g[3010];
int L[3010], R[3010];
int A[3010], B[3010];
inline int jumpr(int x, int k) {
  while (x && k--) x = R[x];
  return x;
}
long long work(int o) {
  long long Z = 0, S = 0;
  for (int i(1); i <= int(m); i++) f[i].clear();
  for (int i(o); i <= int(n); i++)
    for (const auto &x : g[i]) f[c[x].second].push_back(x);
  memset(L, 0, sizeof L);
  memset(R, 0, sizeof R);
  memset(A, 0, sizeof A);
  memset(B, 0, sizeof B);
  int lst = 0;
  for (int i(1); i <= int(m); i++)
    for (const auto &x : f[i]) L[x] = lst, R[lst] = x, lst = x;
  L[0] = lst, R[lst] = 0;
  for (int i = R[0], j = jumpr(R[0], k - 1); i; i = R[i], j = j ? R[j] : 0) {
    A[i] = c[i].second - c[L[i]].second;
    B[i] = j ? m + 1 - c[j].second : 0;
    S += 1LL * A[i] * B[i];
  }
  Z += S;
  for (int t(n); t >= int(o + 1); t--) {
    for (const auto &x : g[t]) {
      S -= 1LL * A[x] * B[x];
      const int l = L[x], r = R[x];
      R[l] = r, L[r] = l;
      if (r) {
        S -= 1LL * A[r] * B[r];
        A[r] = c[r].second - c[l].second;
        S += 1LL * A[r] * B[r];
      }
      int st = l;
      for (int s = 0; s < k && st; ++s, st = L[st])
        ;
      st = R[st];
      int ed = jumpr(st, k - 1);
      while (st != r) {
        S -= 1LL * A[st] * B[st];
        B[st] = ed ? m + 1 - c[ed].second : 0;
        S += 1LL * A[st] * B[st];
        st = R[st], ed = ed ? R[ed] : 0;
      }
    }
    Z += S;
  }
  return Z;
}
void solve() {
  n = read(), m = read(), q = read(), k = read();
  for (int i(1); i <= int(q); i++)
    c[i].first = read(), c[i].second = read(), g[c[i].first].push_back(i);
  long long ans = 0;
  for (int l(1); l <= int(n); l++) ans += work(l);
  printf("%lld\n", ans);
}
int main() {
  for (int T = 1; T--;) solve();
  return 0;
}
