#include <bits/stdc++.h>
using namespace std;
int need[3008];
int n, m, k;
int nxt[3008], bef[3008];
pair<int, int> pos[3008];
int black[3008][3008];
int g;
long long calc(int x) {
  if (need[x])
    return (pos[x].second - pos[bef[x]].second) * (m - pos[need[x]].second + 1);
  else
    return 0;
}
int step[3008][3008];
int aft[3008][3008];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  scanf("%d", &g);
  for (int i = 1; i <= k; i++)
    scanf("%d%d", &pos[i].first, &pos[i].second),
        black[pos[i].first][pos[i].second] = i;
  for (int i = 1; i <= m; i++) {
    int lst = n + 1;
    for (int j = n; j >= 1; j--) {
      step[j][i] = lst;
      if (black[j][i]) lst = j;
    }
  }
  for (int i = 1; i <= n; i++) {
    int lst = m + 1;
    for (int j = m; j >= 1; j--) {
      aft[i][j] = lst;
      if (black[i][j]) lst = j;
    }
  }
  long long allans = 0;
  for (int x1 = 1; x1 <= n; x1++) {
    vector<int> id;
    id.push_back(0);
    for (int i = 1; i <= m; i++)
      for (int j = x1; j <= n; j = step[j][i])
        if (black[j][i]) id.push_back(black[j][i]);
    id.push_back(0);
    long long ans = 0;
    for (int i = 1; i + 1 < id.size(); i++) {
      bef[id[i]] = id[i - 1], nxt[id[i]] = id[i + 1];
      if (i + g - 1 < id.size())
        need[id[i]] = id[i + g - 1];
      else
        need[id[i]] = 0;
      ans += calc(id[i]);
    }
    allans += ans;
    for (int x2 = n; x2 > x1; x2--) {
      for (int i = 1; i <= m; i = aft[x2][i])
        if (black[x2][i]) {
          int x = black[x2][i];
          ans -= calc(x);
          x = bef[x];
          int lg = g - 1;
          while (x and lg) {
            ans -= calc(x);
            need[x] = nxt[need[x]];
            ans += calc(x);
            x = bef[x];
            lg--;
          }
          x = black[x2][i];
          ans -= calc(nxt[x]);
          bef[nxt[x]] = bef[x];
          nxt[bef[x]] = nxt[x];
          bef[0] = nxt[0] = 0;
          ans += calc(nxt[x]);
        }
      allans += ans;
    }
  }
  printf("%lld\n", allans);
  return 0;
}
