#include <bits/stdc++.h>
using namespace std;
const int maxn = 3E3 + 5;
int r, c, n, k;
int a[maxn][maxn], sum[maxn][maxn];
vector<int> coin[maxn];
long long int ans;
int pre[maxn], nxt[maxn], cnt[maxn], have[maxn], R[maxn];
inline int get(int l, int r, int u, int d) {
  return sum[d][r] - sum[d][l - 1] - sum[u - 1][r] + sum[u - 1][l - 1];
}
inline void update(int y, int row, int x, long long int& now) {
  while (R[y] != c + 1 && get(y, R[y], x, row) < k) {
    now -= have[y] * (c - R[y] + 1);
    R[y] = nxt[R[y]];
    now += have[y] * (c - R[y] + 1);
  }
}
inline void solve(int x) {
  long long int now = 0;
  int pos = 1;
  for (int i = 1; i <= c; ++i) {
    pre[i] = i - 1;
    nxt[i] = i + 1;
    while ((pos < i || get(i, pos, x, r) < k) && pos <= c) ++pos;
    R[i] = pos;
    now += c - pos + 1;
    have[i] = 1;
    cnt[i] = get(i, i, x, r);
  }
  for (int i = c; i >= 1; --i)
    if (cnt[i] == 0) {
      pre[nxt[i]] = pre[i];
      nxt[pre[i]] = nxt[i];
      have[nxt[i]] += have[i];
    }
  ans += now;
  R[c + 1] = c + 1;
  for (int row = r; row > x; --row) {
    for (int i = 0; i < coin[row].size(); ++i) {
      int y = coin[row][i];
      --cnt[y];
      if (cnt[y] == 0) {
        pre[nxt[y]] = pre[y];
        nxt[pre[y]] = nxt[y];
        have[nxt[y]] += have[y];
        now -= have[y] * (c - R[y] + 1);
        now += have[y] * (c - R[nxt[y]] + 1);
        for (int z = pre[y], tot = 0; z && tot <= k + 1; z = pre[z], ++tot)
          update(z, row - 1, x, now);
      } else
        for (int z = y, tot = 0; z && tot <= k + 1; z = pre[z], ++tot)
          update(z, row - 1, x, now);
    }
    ans += now;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> r >> c >> n >> k;
  for (int i = 1; i <= n; ++i) {
    int x, y;
    cin >> x >> y;
    a[x][y] = 1;
    coin[x].push_back(y);
  }
  for (int i = 1; i <= r; ++i) {
    sort(coin[i].begin(), coin[i].end());
    reverse(coin[i].begin(), coin[i].end());
  }
  for (int i = 1; i <= r; ++i)
    for (int j = 1; j <= c; ++j)
      sum[i][j] = sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1] + a[i][j];
  for (int i = 1; i <= r; ++i) solve(i);
  cout << ans << endl;
  return 0;
}
