#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
const int N = 3e3 + 5;
int n, m, p, k;
vector<int> G[N];
int t[N], s[N], lst[N], nxt[N];
int main() {
  n = read();
  m = read();
  p = read();
  k = read();
  long long ans = 0;
  for (int i = 1, x, y; i <= p; i++) {
    x = read();
    y = read();
    G[x].push_back(y);
  }
  for (int u = n; u; u--) {
    for (auto x : G[u]) s[x]++;
    int l = 1, r = 0, num = 0;
    long long res = 0;
    while (1) {
      while (r + 1 <= m && num < k) num += s[++r];
      if (num < k) break;
      while (l <= r && num >= k) num -= s[l++], res += m - r + 1;
    }
    for (int i = 1; i <= m; i++) t[i] = s[i];
    for (int i = 0; i <= m + 1; i++) lst[i] = i - 1, nxt[i] = i + 1;
    for (int i = 1; i <= m; i++)
      if (!s[i]) lst[nxt[i]] = lst[i], nxt[lst[i]] = nxt[i];
    for (int d = n; d >= u; d--) {
      ans += res;
      for (auto x : G[d]) {
        int sl = t[x], sr = 0;
        l = r = x;
        while (nxt[r] <= m && sl + sr + t[nxt[r]] <= k) sr += t[r = nxt[r]];
        while (1) {
          if (sl + sr == k) res -= (l - lst[l]) * (nxt[r] - r);
          sl += t[l = lst[l]];
          if (!l || sl > k) break;
          while (sl + sr > k) sr -= t[r], r = lst[r];
        }
        t[x]--;
        if (!t[x]) lst[nxt[x]] = lst[x], nxt[lst[x]] = nxt[x];
      }
    }
  }
  printf("%lld\n", ans);
  return 0;
}
