#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <tuple>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>
#include <cassert>
#include <random>
#include <set>

class Bit {
	std::vector<int>vec;
public:
	Bit(int size) : vec(size, 0){};
	int get(int position) const {
		int result = 0;
		while (position >= 0) {
			result += vec[position];
			position -= (position + 1) & ~position;
		}
		return result;
	}
	void add(int position, int value) {
		while (position < vec.size()) {
			vec[position] += value;
			position += (position + 1) & ~position;
		}
	}
	void clear() {
		std::fill(vec.begin(), vec.end(), 0);
	}
};
int main(void) {
	int height, width, min_size, p; std::cin >> height >> width >> min_size >> p;
	std::vector<std::vector<int>> for_top(height, std::vector<int>(width, 1));
	for (auto i = 0; i < p; ++i) {
		int a, b; std::cin >> a >> b;
		for_top[--a][--b] = 0;
	}
	auto for_bottom = for_top; auto for_right = for_top; auto for_left = for_top;
	for (auto i = 1; i < height; ++i) {
		for (auto j = 0; j < width; ++j) {
			if (for_top[i][j] != 0) {
				for_top[i][j] += for_top[i - 1][j];
			}
			if (for_bottom[height - i - 1][j] != 0) {
				for_bottom[height - i - 1][j] += for_bottom[height - i][j];
			}
		}
	}
	for (auto i = 0; i < height; ++i) {
		for (auto j = 1; j < width; ++j) {
			if (for_left[i][j] != 0) {
				for_left[i][j] += for_left[i][j - 1];
			}
			if (for_right[i][width - j - 1] != 0) {
				for_right[i][width - j - 1] += for_right[i][width - j];
			}
		}
	}
	std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int>>, std::function<bool(std::pair<int, int>&, std::pair<int, int>&)>> history([](std::pair<int, int>& a, std::pair<int, int>& b) {return a.first > b.first; });
	Bit bit(std::min(height, width) + 1);
	long long int count = 0;
	for (int i = -width + 1; i < height; ++i) {
		const int h = std::max(i, 0);
		const int w = std::max(0, h - i);
		for (auto j = 0; h + j < height && w + j < width; ++j) {
			const auto for_next = std::min(for_bottom[h + j][w + j], for_right[h + j][w + j]);
			if (for_next >= min_size) {
				history.emplace(j + for_next - 1, j);
				bit.add(j, 1);
			}
			const auto for_prev = std::min(for_top[h + j][w + j], for_left[h + j][w + j]);
			if (for_prev >= min_size) {
				count += bit.get(j + 1 - min_size) - bit.get(j - for_prev);
			}
			while (!history.empty() && history.top().first == j) {
				bit.add(history.top().second, -1);
				history.pop();
			}
		}
	}
	std::cout << count << '\n';
}

