#include <bits/stdc++.h>
using namespace std;
int n, m, k, c, sum[3005], ts[3005];
int Left[3005], Right[3005];
vector<int> rw[3005];
int main() {
  scanf("%d%d%d%d", &n, &m, &k, &c);
  for (int i = 1; i <= k; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    rw[x].push_back(y);
  }
  long long ans = 0;
  for (int row = n; row >= 1; row--) {
    for (int y : rw[row]) sum[y]++;
    long long yht = 0;
    for (int l = 1, r = 0, cur = 0; l <= m; l++) {
      while (r + 1 <= m && cur < c) cur += sum[++r];
      if (cur >= c) yht += m - r + 1;
      cur -= sum[l];
    }
    for (int y = 1; y <= m; y++)
      Left[y] = y - 1, Right[y] = y + 1, ts[y] = sum[y];
    for (int y = 1; y <= m; y++)
      if (!ts[y]) {
        Left[Right[y]] = Left[y];
        Right[Left[y]] = Right[y];
      }
    for (int x = n; x >= row; x--) {
      ans += yht;
      for (int y : rw[x]) {
        int l = y, r = y;
        int lsum = 0, rsum = 0;
        while (Right[r] <= m && lsum + ts[y] + rsum < c) {
          r = Right[r];
          rsum += ts[r];
        }
        while (true) {
          if (lsum + ts[y] + rsum == c)
            yht -= 1ll * (Right[r] - r) * (l - Left[l]);
          l = Left[l];
          if (l < 1) break;
          lsum += ts[l];
          if (lsum + ts[y] > c) break;
          while (lsum + ts[y] + rsum > c) {
            rsum -= ts[r];
            r = Left[r];
          }
        }
        ts[y]--;
        if (!ts[y]) {
          Left[Right[y]] = Left[y];
          Right[Left[y]] = Right[y];
        }
      }
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
