#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 3010;
const long long INF = 2e9;
const double eps = 1e-6;
const double PI = acos(-1);
struct NODE {
  long long x, y;
  NODE(long long _x = 0, long long _y = 0) : x(_x), y(_y) {}
  bool operator<(const NODE &b) const {
    return y < b.y || (y == b.y && x < b.x);
  }
} s[MAXN], t[MAXN];
struct List {
  long long _pre[MAXN], _nxt[MAXN];
  void del(long long x) {
    _pre[_nxt[x]] = _pre[x];
    _nxt[_pre[x]] = _nxt[x];
  }
  long long pre(long long x) { return _pre[x]; }
  long long nxt(long long x) { return _nxt[x]; }
} L;
long long n, m, c, k, tot, add;
long long Ans, sum[MAXN];
vector<long long> opt[MAXN];
template <typename T>
inline bool read(T &a) {
  a = 0;
  char c = getchar();
  long long f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    a = a * 10 + (c ^ 48);
    c = getchar();
  }
  return a *= f, true;
}
template <typename A, typename... B>
inline bool read(A &x, B &...y) {
  return read(x) && read(y...);
}
void modify(long long x, long long k) {
  add -= t[x].y * sum[x];
  add += t[L.pre(x)].y * sum[x];
  if (L.pre(x) && k > 1) modify(L.pre(x), k - 1);
  if (L.pre(x)) sum[L.pre(x)] += sum[x];
  sum[x] = 0;
}
void calc(long long p) {
  tot = 0;
  for (long long i = 1; i <= n; ++i) opt[i].clear();
  for (long long i = 1; i <= c; ++i) {
    if (s[i].x < p) continue;
    t[++tot] = s[i];
    L._pre[tot] = tot - 1, L._nxt[tot] = tot + 1;
    sum[tot] = 0;
    opt[s[i].x].push_back(tot);
  }
  long long pos = 0;
  add = 0;
  for (long long i = 1; i <= m; ++i) {
    while (pos + 1 <= tot && t[pos + 1].y <= i) pos++;
    if (pos - k + 1 >= 1) sum[pos - k + 1]++, add += t[pos - k + 1].y;
  }
  Ans += add;
  for (long long i = n; i > p; --i) {
    for (auto x : opt[i]) modify(x, k), L.del(x);
    Ans += add;
  }
}
signed main() {
  read(n), read(m), read(c), read(k);
  for (long long i = 1; i <= c; ++i) read(s[i].x), read(s[i].y);
  sort(s + 1, s + c + 1);
  for (long long i = 1; i <= n; ++i) calc(i);
  printf("%lld\n", Ans);
  return 0;
}
