#include <bits/stdc++.h>
using namespace std;
bool mp[4001][4001];
int r[4001][4001], c[4001][4001], d[4001][4001], tree[8001][4001];
vector<pair<int, int> > upd[8001];
int main() {
int h, w, l, p;
scanf("%d %d %d %d", &h, &w, &l, &p);
while (p--) {
int u, v;
scanf("%d %d", &u, &v);
mp[u][v] = true;
}
for (int i = 1;i <= h;++i)
for (int j = 1;j <= w;++j) {
if (mp[i][j])
r[i][j] = 0;
else
r[i][j] = r[i - 1][j] + 1;
}
for (int j = 1;j <= w;++j)
for (int i = 1;i <= h;++i) {
if (mp[i][j])
c[i][j] = 0;
else
c[i][j] = c[i][j - 1] + 1;
}
for (int i = 1;i <= h;++i)
for (int j = 1;j <= w;++j) {
r[i][j] = min(r[i][j], c[i][j]);
c[i][j] = 0;
}
for (int i = h;i >= 1;--i)
for (int j = 1;j <= w;++j) {
if (mp[i][j])
c[i][j] = 0;
else
c[i][j] = c[i + 1][j] + 1;
}
for (int j = w;j >= 1;--j)
for (int i = 1;i <= h;++i) {
if (mp[i][j])
d[i][j] = 0;
else
d[i][j] = d[i][j + 1] + 1;
}
for (int i = 1;i <= h;++i)
for (int j = 1;j <= w;++j)
c[i][j] = min(c[i][j], d[i][j]);
for (int i = 1;i <= h;++i)
for (int j = 1;j <= w;++j)
upd[i - j + 4000].push_back({ i - r[i][j] + 1, i });
for (int i = 4001 - w;i <= 3999 + h;++i)
sort(upd[i].begin(), upd[i].end(), greater<pair<int, int> >());
long long ans = 0;
for (int i = 1;i <= h;++i)
for (int j = 1;j <= w;++j) {
while (!upd[i - j + 4000].empty() && upd[i - j + 4000].back().first <= i) {
for (int x = upd[i - j + 4000].back().second;x <= 4000;x += x & -x)
tree[i - j + 4000][x]++;
upd[i - j + 4000].pop_back();
}
for (int x = max(i + l - 2, i + c[i][j]);x >= 1;x -= x & -x)
ans += tree[i - j + 4000][x];
for (int x = i + l - 2;x >= 1;x -= x & -x)
ans -= tree[i - j + 4000][x];
}
printf("%lld", ans);
return 0;
}