#include <bits/stdc++.h>
using namespace std;
int r, c, n, k;
int vis[3002];
int nxt[3002], pre[3002];
int res[3002];
long long cnt[3002];
long long ans;
struct node {
  int x, y;
  int cnt, num, nxt, pre, res;
} a[3001];
vector<int> q[3001];
int main() {
  cin >> r >> c >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].x >> a[i].y;
  }
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j <= c + 1; j++) {
      cnt[j] = c + 1;
      vis[j] = 0;
      nxt[j] = 0;
      pre[j] = 0;
      res[j] = 0;
    }
    nxt[c + 1] = c + 1;
    for (int j = 1; j <= n; j++) {
      if (a[j].x >= i) {
        vis[a[j].y]++;
        q[a[j].x].push_back(a[j].y);
      }
    }
    int tot = 0;
    for (int j = 1, l = 0; j <= c; j++) {
      while (l <= c && tot < k) {
        tot += vis[++l];
      }
      if (l > c) {
        break;
      }
      cnt[j] = l;
      res[j] = tot;
      tot -= vis[j];
    }
    int last = 0;
    for (int j = 1; j <= c; ++j) {
      if (vis[j]) {
        nxt[last] = j;
        pre[j] = last;
        last = j;
      }
      if (j == c) {
        nxt[last] = c + 1;
        pre[c + 1] = last;
      }
    }
    long long sum = 0;
    for (int j = c + 1; j; j = pre[j]) {
      sum += (c - cnt[j] + 1) * (j - pre[j]);
    }
    for (int j = r; j >= i; j--) {
      for (int l = 0; l < q[j + 1].size(); ++l) {
        int t = q[j + 1][l];
        vis[t]--;
        for (int now = t; now && cnt[now] >= t; now = pre[now]) {
          res[now]--;
          if (res[now] < k) {
            sum -= (nxt[cnt[now]] - cnt[now]) * (now - pre[now]);
            cnt[now] = nxt[cnt[now]];
            res[now] += vis[cnt[now]];
          }
        }
        if (!vis[t]) {
          sum += (c - cnt[nxt[t]] + 1) * (nxt[t] - pre[t]);
          sum -= (c - cnt[t] + 1) * (t - pre[t]) +
                 (c - cnt[nxt[t]] + 1) * (nxt[t] - t);
          pre[nxt[t]] = pre[t];
          nxt[pre[t]] = nxt[t];
        }
      }
      q[j + 1].clear();
      ans += sum;
    }
  }
  printf("%lld", ans);
  return 0;
}
