#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &n) {
  int w = 1;
  n = 0;
  char ch = getchar();
  while (!isdigit(ch) && ch != EOF) {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (isdigit(ch) && ch != EOF) {
    n = (n << 1) + (n << 3) + (ch & 15);
    ch = getchar();
  }
  n *= w;
}
const int N = 3005;
int n, m, p, k, s[N], t[N], las[N], nxt[N];
long long ans = 0;
vector<int> g[N];
int main() {
  read(n);
  read(m);
  read(p);
  read(k);
  int x, y, l, r, num;
  long long inc;
  for (int i = 1; i <= p; i++) {
    read(x);
    read(y);
    g[x].push_back(y);
  }
  for (int u = n; u; u--) {
    for (int i = 0; i < g[u].size(); i++) s[g[u][i]]++;
    l = 1, r = 0, num = 0, inc = 0;
    while (1) {
      while (r < m && num < k) num += s[++r];
      if (num < k) break;
      while (l <= r && num >= k) num -= s[l++], inc += m - r + 1;
    }
    memcpy(t, s, sizeof(t));
    for (int i = 0; i <= m + 1; i++) las[i] = i - 1, nxt[i] = i + 1;
    for (int i = 1; i <= m; i++)
      if (s[i] == 0) las[nxt[i]] = las[i], nxt[las[i]] = nxt[i];
    for (int v = n; v >= u; v--) {
      ans += inc;
      for (int i = 0; i < g[v].size(); i++) {
        int c = g[v][i], sl = t[c], sr = 0;
        l = r = c;
        while (nxt[r] <= m && sl + sr + t[nxt[r]] <= k) sr += t[r = nxt[r]];
        while (1) {
          if (sl + sr == k) inc -= (l - las[l]) * (nxt[r] - r);
          sl += t[l = las[l]];
          if (!l || sl > k) break;
          while (sl + sr > k) sr -= t[r], r = las[r];
        }
        t[c]--;
        if (t[c] == 0) las[nxt[c]] = las[c], nxt[las[c]] = nxt[c];
      }
    }
  }
  printf("%lld", ans);
  return 0;
}
