#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e3 + 5;
struct Coor {
  int x, y;
} P[MAXN];
vector<int> Row[MAXN], Line[MAXN];
int R, C, N, K, tot;
int Ex[MAXN], Go[MAXN], Pre[MAXN], Next[MAXN];
long long Ans, Sum;
long long Calc(int x) {
  return 1ll * (C - P[Go[x]].y + 1) * (P[x].y - P[Pre[x]].y);
}
void Prepare(int i) {
  for (int j = 1; j <= C; j++)
    for (int k = 0; k < Line[j].size(); k++) {
      int Now = Line[j][k];
      if (P[Now].x < i) continue;
      Ex[++tot] = Now;
    }
  Ex[tot + 1] = N + 1;
  for (int j = 1; j <= tot; j++) {
    Pre[Ex[j]] = Ex[j - 1], Next[Ex[j]] = Ex[j + 1];
    Go[Ex[j]] = Ex[min(j + K - 1, tot + 1)];
    Sum += Calc(Ex[j]);
  }
  Ans += Sum;
}
void Solve() {
  for (int i = 1; i <= R; i++) {
    tot = 0, Sum = 0;
    Prepare(i);
    for (int j = R; j >= i; j--) {
      for (int k = 0; k < Row[j].size(); k++) {
        int Now = Row[j][k];
        int t = Next[Now];
        if (t != N + 1) Sum -= Calc(t);
        Pre[Next[Now]] = Pre[Now], Next[Pre[Now]] = Next[Now];
        if (t != N + 1) Sum += Calc(t);
        if (Go[Now] != N + 1) {
          Sum -= Calc(Now);
          for (int t = Pre[Now], Cnt = K - 1; t && Cnt; t = Pre[t], Cnt--) {
            Sum -= Calc(t);
            Go[t] = Next[Go[t]];
            Sum += Calc(t);
          }
        } else {
          tot = 0;
          for (int t = Next[Now]; t; t = Next[t]) Ex[++tot] = t;
          reverse(Ex + 1, Ex + tot + 1);
          for (int t = Pre[Now], Cnt = K - 1; t && Cnt; t = Pre[t], Cnt--) {
            Sum -= Calc(t);
            Ex[++tot] = t;
            Go[t] = (tot - K + 1 > 0) ? Ex[tot - K + 1] : N + 1;
            Sum += Calc(t);
          }
        }
      }
      Ans += Sum;
    }
  }
  printf("%I64d", Ans);
}
int main() {
  scanf("%d%d%d%d", &R, &C, &N, &K);
  for (int i = 1; i <= N; i++) {
    scanf("%d%d", &P[i].x, &P[i].y);
    Row[P[i].x].push_back(i);
    Line[P[i].y].push_back(i);
  }
  P[N + 1].y = C + 1;
  Solve();
}
