#include <bits/stdc++.h>   using namespace std;   namespace io {   const int SI = 1 << 21 | 1;   char IB[SI], *IS, *IT, OB[SI], *OS = OB, *OT = OS + SI - 1, c, ch[100];   int f, t;   inline void flush() { fwrite(OB, 1, OS - OB, stdout), OS = OB; }   inline void pc(char x) {     *OS++ = x;     if (OS == OT) flush();   }   template <class I>   inline void rd(I &x) {     for (f = 1, c = (IS == IT ? (IT = (IS = IB) + fread(IB, 1, SI, stdin),                                 IS == IT ? EOF : *IS++)                               : *IS++);          c <  0  || c >  9 ;          c = (IS == IT ? (IT = (IS = IB) + fread(IB, 1, SI, stdin),                          IS == IT ? EOF : *IS++)                        : *IS++))       if (c ==  - ) f = -1;     for (x = 0; c >=  0  && c <=  9 ; x = (x << 3) + (x << 1) + (c & 15),         c = (IS == IT ? (IT = (IS = IB) + fread(IB, 1, SI, stdin),                         IS == IT ? EOF : *IS++)                       : *IS++))       ;     x *= f;   }   template <class I>   inline void rda(I *a, int &n) {     for (int i = 1; i <= n; i++) rd(a[i]);   }   inline void rds(char *s, int &x) {     for (c = (IS == IT ? (IT = (IS = IB) + fread(IB, 1, SI, stdin),                          IS == IT ? EOF : *IS++)                        : *IS++);          c < 33 || c > 126;          c = (IS == IT ? (IT = (IS = IB) + fread(IB, 1, SI, stdin),                          IS == IT ? EOF : *IS++)                        : *IS++))       ;     for (x = 0; c >= 33 && c <= 126;          s[++x] = c, c = (IS == IT ? (IT = (IS = IB) + fread(IB, 1, SI, stdin),                                      IS == IT ? EOF : *IS++)                                    : *IS++))       ;     s[x + 1] =   0 ;   }   template <class I>   inline void print(I x, char k =   n ) {     if (!x) pc( 0 );     if (x < 0) pc( - ), x = -x;     while (x) ch[++t] = x % 10 +  0 , x /= 10;     while (t) pc(ch[t--]);     pc(k);   }   inline void prints(string s) {     int x = s.length();     while (t < x) pc(s[t++]);     pc(  n ), t = 0;   }   struct Flush {     ~Flush() { flush(); }   } flusher;   }  // namespace io   using io::print;   using io::prints;   using io::rd;   using io::rda;   using io::rds;   const int N = 3e3 + 7;   int r, c, n, k, p[N], q[N], t[N], v[N];   pair<int, int> a[N];   vector<pair<int, int> > R[N], C[N];   long long ans;   inline long long calc(int i, int j, int o) {     long long ret = 1ll * (t[o] - j + 1) * (a[o].second - a[p[o]].second) *                     (c - a[v[o]].second + 1);     t[o] = j - 1;     return ret;   }   int main() {     rd(r), rd(c), rd(n), rd(k);     for (int i = 1, x, y; i <= n; i++)       rd(x), rd(y), a[i] = make_pair(x, y), R[x].push_back(make_pair(y, i)),                     C[y].push_back(make_pair(x, i));     for (int i = 1; i <= r; i++) sort(R[i].begin(), R[i].end());     for (int i = 1; i <= c; i++) sort(C[i].begin(), C[i].end());     a[n + 1] = make_pair(r + 1, c + 1);     for (int i = 1; i <= r; i++) {       int o = 0;       for (int j = 1; j <= c; j++)         for (pair<int, int> x : C[j])           if (x.first >= i)             q[o] = x.second, p[x.second] = o, o = x.second, t[o] = r, v[o] = 0;       q[o] = q[n + 1] = v[n + 1] = n + 1, t[n + 1] = r, o = 0;       for (int j = 1; j <= k; j++) o = q[o];       for (int j = q[0]; j != n + 1; j = q[j], o = q[o]) v[j] = o;       for (int j = r; j >= i; j--)         for (pair<int, int> x : R[j]) {           ans += calc(i, j, q[x.second]), o = x.second;           for (int l = 1; o && l <= k; l++, o = p[o]) ans += calc(i, j, o);           q[p[x.second]] = q[x.second], p[q[x.second]] = p[x.second];           int w = o = q[o];           for (int l = 1; l < k; l++) w = q[w];           while (o != q[x.second]) v[o] = w, o = q[o], w = q[w];         }     }     print(ans);     return 0;   }