#include <bits/stdc++.h>
using namespace std;
namespace IO {
const int sz = 1 << 15;
char inbuf[sz], outbuf[sz];
char *pinbuf = inbuf + sz;
char *poutbuf = outbuf;
inline char _getchar() {
  if (pinbuf == inbuf + sz) fread(inbuf, 1, sz, stdin), pinbuf = inbuf;
  return *(pinbuf++);
}
inline void _putchar(char x) {
  if (poutbuf == outbuf + sz) fwrite(outbuf, 1, sz, stdout), poutbuf = outbuf;
  *(poutbuf++) = x;
}
inline void flush() {
  if (poutbuf != outbuf)
    fwrite(outbuf, 1, poutbuf - outbuf, stdout), poutbuf = outbuf;
}
}  // namespace IO
inline int read() {
  int x = 0, p = 1;
  char c = IO::_getchar();
  while (c < '0' || c > '9') {
    if (c == '-') p = -1;
    c = IO::_getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - 48, c = IO::_getchar();
  return x * p;
}
const int Maxn = 3005;
int n, m, Q, k;
vector<int> pos[Maxn];
int pre[Maxn], nxt[Maxn], val[Maxn], Rs[Maxn], curid;
int Hd;
set<pair<int, int> > V;
int tots = 0;
void Insert(int id, int pr, int _val) {
  val[id] = _val;
  if (pr == -1) {
    if (Hd != -1) pre[Hd] = id;
    nxt[id] = Hd;
    Hd = id;
    return;
  }
  Rs[id] = Rs[pr];
  int Nx = nxt[pr];
  nxt[pr] = id;
  pre[id] = pr;
  nxt[id] = Nx;
  if (Nx != -1) pre[Nx] = id;
}
void Clear() {
  V.clear();
  for (int i = 0; i < Maxn; i++)
    pre[i] = nxt[i] = -1, Rs[i] = m + 1, val[i] = 0;
  tots = 0;
  Hd = -1;
  curid = 0;
  Insert(++curid, -1, 0);
  Insert(++curid, 1, m + 1);
  Rs[1] = m + 1;
  V.insert(make_pair(0, 1));
  V.insert(make_pair(m + 1, 2));
}
int TmpNxt[15];
void Addc(int pos) {
  int Id = ++curid;
  V.insert(make_pair(pos, Id));
  set<pair<int, int> >::iterator it = V.find(make_pair(pos, Id)), it2;
  int preid, nxtid;
  it2 = it;
  it2--;
  preid = it2->second;
  it++;
  nxtid = it->second;
  int L = val[preid] + 1, R = pos;
  tots -= (R - L + 1) * (m + 1 - Rs[preid]);
  Insert(Id, preid, pos);
  int CurPos = Id;
  for (int i = 0; i < k - 1; i++) {
    TmpNxt[i] = CurPos;
    if (CurPos != -1) CurPos = nxt[CurPos];
  }
  TmpNxt[k - 1] = CurPos;
  Rs[preid] = (CurPos == -1) ? m + 1 : val[CurPos];
  tots += (R - L + 1) * (m + 1 - Rs[preid]);
  CurPos = preid;
  for (int i = 0; i < k - 1; i++) {
    int tmpR = val[CurPos];
    CurPos = pre[CurPos];
    if (CurPos == -1) break;
    int tmpL = val[CurPos] + 1;
    tots -= (tmpR - tmpL + 1) * (m + 1 - Rs[CurPos]);
    int NwP = (k - 2 - i >= 0) ? TmpNxt[k - 2 - i] : Id;
    Rs[CurPos] = (NwP == -1) ? m + 1 : val[NwP];
    tots += (tmpR - tmpL + 1) * (m + 1 - Rs[CurPos]);
  }
}
int TS[55][55];
int main() {
  scanf("%d %d %d %d", &n, &m, &Q, &k);
  for (int i = 0; i < Q; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    pos[x].push_back(y);
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    Clear();
    for (int j = i; j <= n; j++) {
      for (int k = 0; k < pos[j].size(); k++) {
        int y = pos[j][k];
        Addc(y);
      }
      ans += tots;
    }
  }
  printf("%I64d\n", ans);
  return ~~(0 ^ 0 ^ 0);
}
