@staticmethod
def c():
    (h, w, k, n, *rc) = map(int, sys.stdin.read().split())
    (r, c) = (np.array(rc).reshape(n, 2).T - 1)
    rb = np.bincount(r, minlength=h)
    cb = np.bincount(c, minlength=w)
    rbb = np.bincount(rb, minlength=(k + 1))
    cbb = np.bincount(cb, minlength=(k + 1))
    tot = (rbb[:(k + 1)] * cbb[k::(- 1)]).sum()
    real = np.bincount(((rb[r] + cb[c]) - 1), minlength=(k + 1))
    print(((tot - real[(k - 1)]) + real[k]))
@staticmethod
def c():
    (h, w, k, n, *rc) = map(int, sys.stdin.read().split())
    (r, c) = (np.array(rc).reshape(n, 2).T - 1)
    rb = np.bincount(r, minlength=h)
    cb = np.bincount(c, minlength=w)
    rbb = np.bincount(rb, minlength=(k + 1))
    cbb = np.bincount(cb, minlength=(k + 1))
    tot = (rbb[:(k + 1)] * cbb[k::(- 1)]).sum()
    real = np.bincount(((rb[r] + cb[c]) - 1), minlength=(k + 1))
    print(((tot - real[(k - 1)]) + real[k]))