#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, m, q, k, cnt[N], tmp[N], pre[N], nxt[N];
long long ans;
vector<int> e[N];
void gi(int &x) {
  x = 0;
  register char c = getchar();
  for (; c < '0' || c > '9'; c = getchar())
    ;
  for (; c >= '0' && c <= '9'; c = getchar()) x = x * 10 + (c ^ 48);
}
int main() {
  gi(n), gi(m), gi(q), gi(k);
  for (int i = (1); i <= (q); i++) {
    int x, y;
    gi(x), gi(y), e[x].push_back(y);
  }
  for (int i = (n); i >= (1); i--) {
    for (auto v : e[i]) ++cnt[v];
    int sum = 0, now = 0;
    for (int r = 1, l = 0; r <= m; r++) {
      now += cnt[r];
      for (; now - cnt[l] >= k; now -= cnt[l], ++l)
        ;
      if (now >= k) sum += l;
    }
    for (int j = (1); j <= (m); j++)
      tmp[j] = cnt[j], pre[j] = j - 1, nxt[j] = j + 1;
    for (int j = (1); j <= (m); j++)
      if (!tmp[j]) pre[nxt[j]] = pre[j], nxt[pre[j]] = nxt[j];
    for (int j = (n); j >= (i); j--) {
      ans += sum;
      if (j == i) break;
      for (auto v : e[j]) {
        int l = v, r = v, res = tmp[v];
        for (; nxt[r] <= m && res < k; r = nxt[r], res += tmp[r])
          ;
        for (; r >= v && l;) {
          if (res == k) sum -= (l - pre[l]) * (nxt[r] - r);
          l = pre[l], res += tmp[l];
          for (; r >= v && res - tmp[r] >= k; res -= tmp[r], r = pre[r])
            ;
        }
        --tmp[v];
        if (!tmp[v]) pre[nxt[v]] = pre[v], nxt[pre[v]] = nxt[v];
      }
    }
  }
  printf("%lld\n", ans);
  return 0;
}
