#include <bits/stdc++.h>
using namespace std;
const int maxn = 3005;
int n, m, p, k;
int s[maxn], t[maxn], last[maxn], nxt[maxn];
long long ans;
vector<int> dot[maxn];
int main() {
  scanf("%d%d%d%d", &n, &m, &p, &k);
  for (int i = 1; i <= p; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    dot[x].push_back(y);
  }
  for (int u = n; u >= 1; --u) {
    for (int i = 0; i < dot[u].size(); ++i) ++s[dot[u][i]];
    int l = 1, r = 0, num = 0;
    long long inc = 0;
    while (true) {
      while (r + 1 <= m && num < k) num += s[++r];
      if (num < k) break;
      while (l <= r && num >= k) num -= s[l++], inc += m - r + 1;
    }
    for (int i = 1; i <= m; ++i) t[i] = s[i];
    for (int i = 0; i <= m + 1; ++i) last[i] = i - 1, nxt[i] = i + 1;
    for (int i = 1; i <= m; ++i)
      if (!s[i]) last[nxt[i]] = last[i], nxt[last[i]] = nxt[i];
    for (int d = n; d >= u; --d) {
      ans += inc;
      for (int i = 0; i < dot[d].size(); ++i) {
        int cur = dot[d][i], sl = t[cur], sr = 0;
        l = r = cur;
        while (nxt[r] <= m && sl + sr + t[nxt[r]] <= k) sr += t[r = nxt[r]];
        while (true) {
          if (sl + sr == k) inc -= (l - last[l]) * (nxt[r] - r);
          sl += t[l = last[l]];
          if (!l || sl > k) break;
          while (sl + sr > k) sr -= t[r], r = last[r];
        }
        --t[cur];
        if (!t[cur]) last[nxt[cur]] = last[cur], nxt[last[cur]] = nxt[cur];
      }
    }
  }
  printf("%lld\n", ans);
  return 0;
}
