#include<iostream>
#include<queue>
#include<functional>
#include<cstdio>
#include<cstring>
using namespace std;
typedef long long int LL;
typedef pair<int, int> PII;
typedef vector<PII> VP;
typedef priority_queue<PII, VP, greater<PII> > Q;

int h, w, l, p;
int es[4010][4010], wn[4010][4010];
long long int ans = 0;

struct segtree{
  int tree[10001];
  int size;
  void reset(int n){
    size = 1;
    while(n > size)
      size *= 2;
    
    memset(tree, 0, sizeof tree);
    return;
  }

  void plus(int point){
    tree[size - 2 + point]++;
    
    int now = size - 2 + point;
    while(now > 0){
      now = (now - 1) / 2;
      tree[now]++;
    }
    
    return;
  }

  void minus(int point){
    tree[size - 2 + point]--;
    
    int now = size - 2 + point;
    while(now > 0){
      now = (now - 1) / 2;
      tree[now]--;
    }
    
    return;
  }

  long long int sum(int l, int r, int nowl, int nowr, int now){
    if(r < nowl || nowr < l)
      return 0;
    if(l <= nowl && nowr <= r)
      return tree[now];
    return sum(l, r, nowl, (nowl + nowr) / 2, now * 2 + 1) + sum(l, r, (nowl + nowr) / 2 + 1, nowr, now * 2 + 2);
  }
};

int main()
{
  scanf("%d%d%d%d", &h, &w, &l, &p);
  
  for(int i = 0; i < p; i++){
    int a, b;
    scanf("%d%d", &a, &b);
    es[a][b] = wn[a][b] = -1;
  }

  for(int i = 2; i <= h; i++)
    for(int j = 2; j <= w; j++)
      if(wn[i][j] != -1)
	wn[i][j] = wn[i - 1][j] + 1;

  for(int i = 2; i <= h; i++){
    int count = 0;
    for(int j = 2; j <= w; j++)
      if(wn[i][j] != -1)
	wn[i][j] = min(wn[i][j], ++count);
      else
	count = -1;
  }

  for(int i = h - 1; i > 0; i--)
    for(int j = w - 1; j > 0; j--)
      if(es[i][j] != -1)
	es[i][j] = es[i + 1][j] + 1;

  for(int i = h - 1; i > 0; i--){
    int count = 0;
    for(int j = w - 1; j > 0; j--)
      if(es[i][j] != -1)
	es[i][j] = min(es[i][j], ++count);
      else
	count = -1;
  }

  for(int i = 1; i <= h; i++){
    segtree sr;
    sr.reset(h);
    Q q;
    
    for(int j = i, k = 1; j <= h; j++, k++){
      if(k - l >= 0 && es[j - l + 1][k - l + 1] >= l - 1){
	sr.plus(j - l + 1);
	q.push(make_pair(j - l + 1 + es[j - l + 1][k - l + 1], j - l + 1));
      }
      if(wn[j][k] >= l - 1){
	ans += sr.sum(j - wn[j][k], j, 1, sr.size, 0);
	//cout << j << " " << k << " " << sr.sum(j - wn[j][k], j, 1, sr.size, 0) << endl;
      }
      while(!q.empty()){
	PII now = q.top();
	if(now.first == j){
	  sr.minus(now.second);
	  q.pop();
	}
	else
	  break;
      }
    }
  }

  for(int i = 2; i <= w; i++){
    segtree sr;
    sr.reset(h);
    Q q;

    for(int j = 1, k = i; k <= w; j++, k++){
      if(j - l >= 0 && es[j - l + 1][k - l + 1] >= l - 1){
	sr.plus(j - l + 1);
	q.push(make_pair(j - l + 1 + es[j - l + 1][k - l + 1], j - l + 1));
      }
      if(wn[j][k] >= l - 1){
	ans += sr.sum(j - wn[j][k], j, 1, sr.size, 0);
	//cout << j << " " << k << " " << sr.sum(j - wn[j][k], j, 1, sr.size, 0) << endl;
      }
      while(!q.empty()){
	PII now = q.top();
	if(now.first == j){
	  sr.minus(now.second);
	  q.pop();
	}
	else
	  break;
      }
    }
  }
  /*
  for(int i = 1; i <= h; i++){
    segtree sr;
    sr.reset(h);
    Q q;
    
    for(int j = i, k = 1; j <= h; j++, k++){
      if(k - l >= 0 && es[j - l + 1][k - l + 1] >= l - 1){
	sr.plus(j - l + 1 + es[j - l + 1][k - l + 1]);
	q.push(j - l + 1 + es[j - l + 1][k - l + 1]);
      }
      if(wn[j][k] >= l - 1){
	ans += sr.sum(j - wn[j][k], h, 1, sr.size, 0);
	cout << j << " " << k << " " << sr.sum(j - wn[j][k], h, 1, sr.size, 0) << endl;
      }
      while(!q.empty() && q.top() == j){
	sr.minus(j);
	q.pop();
      }
    }
  }
  
  for(int i = 2; i <= w; i++){
    segtree sr;
    sr.reset(h);
    Q q;

    for(int j = 1, k = i; k <= w; j++, k++){
      if(j - l >= 0 && es[j - l + 1][k - l + 1] >= l - 1){
	sr.plus(j - l + 1 + es[j - l + 1][k - l + 1]);
	q.push(j - l + 1 + es[j - l + 1][k - l + 1]);
      }
      if(wn[j][k] >= l - 1){
	ans += sr.sum(j - wn[j][k], h, 1, sr.size, 0);
	cout << j << " " << k << " " << sr.sum(j - wn[j][k], h, 1, sr.size, 0) << endl;
      }
      while(!q.empty() && q.top() == j){
	sr.minus(j);
	q.pop();
      }
    }
  }
   */
  /*
  for(int i = 1; i <= h; i++){
    for(int j = 1; j <= w; j++)
      printf("%3d", es[i][j]);
    putchar('\n');
  }
  putchar('\n');
  for(int i = 1; i <= h; i++){
    for(int j = 1; j <= w; j++)
      printf("%3d", wn[i][j]);
    putchar('\n');
    }
  */

  printf("%lld\n", ans);
  return 0;
}

Measured memory_bytes: 126748