#include <bits/stdc++.h>
using namespace std;
int n, m, p, k;
long long ans, now;
const int N = 3010;
int s[N], t[N], last[N], nt[N];
vector<int> d[N];
int main() {
  cin >> n >> m >> p >> k;
  for (int i = 1, x, y; i <= p; ++i) {
    scanf("%d%d", &x, &y);
    d[x].push_back(y);
  }
  for (int up = n, l, r, num, cur, sl, sr; up >= 1; --up) {
    for (int i = 0, siz = d[up].size(); i < siz; ++i) ++s[d[up][i]];
    l = 1;
    r = 0;
    num = 0;
    now = 0;
    while (1) {
      while (r + 1 <= m && num < k) ++r, num += s[r];
      if (num < k) break;
      while (l <= r && num >= k) num -= s[l], ++l, now += m - r + 1;
    }
    for (int i = 1; i <= m; ++i) t[i] = s[i];
    for (int i = 0; i <= m + 1; ++i) last[i] = i - 1, nt[i] = i + 1;
    for (int i = 1; i <= m; ++i)
      if (!s[i]) last[nt[i]] = last[i], nt[last[i]] = nt[i];
    for (int down = n; down >= up; --down) {
      ans += now;
      for (int i = 0, siz = d[down].size(); i < siz; ++i) {
        cur = d[down][i];
        sl = t[cur];
        sr = 0;
        l = r = cur;
        while (nt[r] <= m && sl + sr + t[nt[r]] <= k) r = nt[r], sr += t[r];
        while (1) {
          if (sl + sr == k) now -= (l - last[l]) * (nt[r] - r);
          l = last[l];
          sl += t[l];
          if (!l || sl > k) break;
          while (sl + sr > k) sr -= t[r], r = last[r];
        }
        --t[cur];
        if (!t[cur]) last[nt[cur]] = last[cur], nt[last[cur]] = nt[cur];
      }
    }
  }
  cout << ans;
  return 0;
}
