#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = false;
  while (!isdigit(c)) {
    if (c == '-') flag = true;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  if (flag) x = -x;
}
int n, m, t, k;
long long ans;
int v[3010], s[3010], pre[3010], nxt[3010];
vector<int> ve[3010];
int main() {
  read(n), read(m), read(t), read(k);
  for (int i = 1; i <= t; ++i) {
    int x, y;
    read(x), read(y), ve[x].push_back(y);
  }
  for (int u = n; u; --u) {
    for (int i = 0; i < ve[u].size(); ++i) v[ve[u][i]]++;
    int l = 1, r = 0, sum = 0;
    long long val = 0;
    while (true) {
      while (r + 1 <= m && sum < k) sum += v[++r];
      if (sum < k) break;
      while (l <= r && sum >= k) sum -= v[l++], val += m - r + 1;
    }
    for (int i = 0; i <= m + 1; ++i) pre[i] = i - 1, nxt[i] = i + 1;
    for (int i = 1; i <= m; ++i) {
      if (!v[i]) nxt[pre[i]] = nxt[i], pre[nxt[i]] = pre[i];
      s[i] = v[i];
    }
    for (int d = n; d >= u; --d) {
      ans += val;
      for (int i = 0; i < ve[d].size(); ++i) {
        int p = ve[d][i], ls = s[p], rs = 0;
        l = r = p;
        while (nxt[r] <= m && ls + rs + s[nxt[r]] <= k) rs += s[r = nxt[r]];
        while (true) {
          if (ls + rs == k) val -= (l - pre[l]) * (nxt[r] - r);
          ls += s[l = pre[l]];
          if (!l || ls > k) break;
          while (ls + rs > k) rs -= s[r], r = pre[r];
        }
        s[p]--;
        if (!s[p]) nxt[pre[p]] = nxt[p], pre[nxt[p]] = pre[p];
      }
    }
  }
  printf("%lld", ans);
  return 0;
}
