#include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 11;
int r, c, n, K;
int cnt[N][N], nex[N][N], s[N][N];
long long ans;
struct link {
  int nex, las, knex, cnt, tot;
} t[N];
int dl[N], tl;
int main() {
  cin >> r >> c >> n >> K;
  int x, y;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &x, &y);
    cnt[x][y]++;
  }
  for (int i = 1; i <= r; i++) {
    nex[i][c + 1] = c + 1;
    for (int j = c; j >= 0; j--) {
      if (cnt[i][j + 1])
        nex[i][j] = j + 1;
      else
        nex[i][j] = nex[i][j + 1];
    }
  }
  for (int i = 1; i <= c; i++) {
    for (int j = 1; j <= r; j++) {
      s[i][j] = s[i][j - 1] + cnt[j][i];
    }
  }
  for (int up = 1; up <= r; up++) {
    int lst = 0;
    long long res = 0;
    tl = 0;
    for (int i = 1; i <= c; i++) {
      if (s[i][r] - s[i][up - 1]) {
        t[i].las = lst;
        if (lst) t[lst].nex = i;
        lst = i;
        t[i].tot = t[i].cnt = s[i][r] - s[i][up - 1];
        dl[++tl] = i;
      }
    }
    t[lst].nex = c + 1;
    for (int i = 1; i <= tl; i++) {
      int x = dl[i];
      t[x].knex = x;
      while (t[x].tot < K && t[t[x].knex].nex != c + 1) {
        t[x].knex = t[t[x].knex].nex;
        t[x].tot += t[t[x].knex].cnt;
      }
      if (t[x].tot >= K) {
        res += (x - t[x].las) * (c - t[x].knex + 1);
      }
    }
    ans += res;
    for (int dw = r; dw > up; dw--) {
      for (int x = nex[dw][0]; x != c + 1; x = nex[dw][x]) {
        t[x].cnt -= cnt[dw][x];
        for (int y = x; y && t[y].knex >= x; y = t[y].las) {
          if (t[y].tot >= K) res -= (y - t[y].las) * (c - t[y].knex + 1);
          t[y].tot -= cnt[dw][x];
          while (t[y].tot < K && t[t[y].knex].nex != c + 1) {
            t[y].knex = t[t[y].knex].nex;
            t[y].tot += t[t[y].knex].cnt;
          }
          if (t[y].tot >= K) {
            res += (y - t[y].las) * (c - t[y].knex + 1);
          }
        }
        if (!t[x].cnt) {
          t[t[x].nex].las = t[x].las;
          t[t[x].las].nex = t[x].nex;
        }
      }
      ans += res;
    }
  }
  cout << ans << endl;
  return 0;
}
