Paul is at the orchestra. The string section is arranged in an r × c rectangular grid and is filled with violinists with the exception of n violists. Paul really likes violas, so he would like to take a picture including at least k of them. Paul can take a picture of any axis-parallel rectangle in the orchestra. Count the number of possible pictures that Paul can take.

Two pictures are considered to be different if the coordinates of corresponding rectangles are different.

Input

The first line of input contains four space-separated integers r, c, n, k (1 ≤ r, c, n ≤ 3000, 1 ≤ k ≤ min(n, 10)) — the number of rows and columns of the string section, the total number of violas, and the minimum number of violas Paul would like in his photograph, respectively.

The next n lines each contain two integers xi and yi (1 ≤ xi ≤ r, 1 ≤ yi ≤ c): the position of the i-th viola. It is guaranteed that no location appears more than once in the input.

Output

Print a single integer — the number of photographs Paul can take which include at least k violas. 

Examples

Input

2 2 1 1
1 2


Output

4


Input

3 2 3 3
1 1
3 1
2 2


Output

1


Input

3 2 3 2
1 1
3 1
2 2


Output

4

Note

We will use '*' to denote violinists and '#' to denote violists.

In the first sample, the orchestra looks as follows: 
    
    
      
    *#  
    **  
    

Paul can take a photograph of just the viola, the 1 × 2 column containing the viola, the 2 × 1 row containing the viola, or the entire string section, for 4 pictures total.

In the second sample, the orchestra looks as follows: 
    
    
      
    #*  
    *#  
    #*  
    

Paul must take a photograph of the entire section.

In the third sample, the orchestra looks the same as in the second sample.
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.Random;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Ben King
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        EOrchestra solver = new EOrchestra();
        solver.solve(1, in, out);
        out.close();
    }

    static class EOrchestra {
        final int inf = 987654321;
        int R;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            Random random = new Random();
            R = in.nextInt();
            long C = in.nextInt();
            long N = in.nextInt();
            long K = in.nextInt();
            List<List<Integer>> violasByColumn = new ArrayList<>();
            for (int i = 0; i < C; i++) violasByColumn.add(new ArrayList<>());
            for (int i = 0; i < N; i++) {
                int x = in.nextInt() - 1;
                int y = in.nextInt() - 1;
                violasByColumn.get(y).add(x);
            }

//        R = 20;
//        C = 20;
//        K = 1;
//        boolean[][] board = new boolean[R][C];
//        for (int i = 0; i < R; i++) violasByColumn.add(new ArrayList<>());
//        for (int i = 0; i < R; i++) {
//            for (int j = 0; j < C; j++) {
//                board[i][j] = random.nextBoolean();
//                System.out.print(board[i][j] ? 1 + " " : 0 + " ");
//            }
//            System.out.println();
//        }

//        for (int i = 0; i < C; i++) {
//            for (int j = 0; j < R; j++) {
//                if (board[j][i]) violasByColumn.get(i).add(j);
//            }
//        }


            long totalSubtract = 0;
//        int[][] ul = precompute(violasByColumn, R, C);

//        int bench = sol(ul, K);

            for (int leftColumn = 0; leftColumn <= C - 1; leftColumn++) {
                Node[] list = buildList(leftColumn, (int) (C - 1), violasByColumn);
//            list[0].print();

                long total = 0;
                long totalRound = 0;
//            System.out.println("twop: " + total);
//            int x = getsum(ul, R-1, C-1, 0, leftColumn, K);
//            x -= getsum(ul, R-1, C-1, 0, leftColumn+1, K);
//            x -= getsum(ul, R-1, C-2, 0, leftColumn, K);
//            x += getsum(ul, R-1, C-2, 0, leftColumn+1, K);

                for (int rightColumn = (int) (C - 1); rightColumn >= leftColumn; rightColumn--) {
                    for (int i : violasByColumn.get(rightColumn)) {
                        total += calcNewRects(list, i + 1, (int) K);
//                    if (rightColumn == leftColumn) System.out.println("POOOOOP");
//                    System.out.println(total);
                        Node node = list[i + 1];
                        node.val--;
                        if (node.val == 0) {
                            node.prev.next = node.next;
                            node.next.prev = node.prev;
//                        if (K == 1) total++; // for line rectangle of just this node
                        }


                    }

                    if (leftColumn != rightColumn)
                        totalRound += total;
                }
                long margin = (R * (R + 1) / 2 - total);
                totalRound += (C - leftColumn) * margin;

//            int x = getsum(ul, R-1, C-1, 0, leftColumn, K);
//            x -= getsum(ul, R-1, C-1, 0, leftColumn+1, K);
//            x -= getsum(ul, R-1, rightColumn-2, 0, leftColumn, K);
//            x += getsum(ul, R-1, rightColumn-2, 0, leftColumn+1, K);

//            System.out.println("DONE");
//            if (x != (R * (R+1) / 2) * ((C - leftColumn))  - totalRound) {
//                System.out.println("FAILED: " + x + " " + ( ((R * (R+1) / 2) * (C - leftColumn)) - totalRound) ) ;
//            }

                totalSubtract += totalRound;
            }

            long totalGood = (R * (R + 1) / 2) * (C * (C + 1) / 2);


//        System.out.println(totalGood + " " + totalSubtract);
//        out.println(totalGood - totalSubtract + " " + bench);
            out.println(totalGood - totalSubtract);
            out.flush();
        }

        public long calcNewRects(Node[] list, int i, int k) {
            Node node = list[i];
//        Walk oldLeft = new Walk(node, 0);
            Walk newLeft = new Walk(node, 0);
            Walk oldRight = new Walk(node, 0);
            moveLeft(newLeft, k);
            Walk newRight = new Walk(node, 0);
            moveRightOne(newRight);

            long total = 0;

            while (newLeft.node.val == inf && newLeft.num < newLeft.node.val - 1) {
                moveRightOne(oldRight);
                moveRightOne(newLeft);
                moveRightOne(newRight);
            }

//        System.out.println("|nodes|: ");
//        System.out.println(newLeft.node.index);
//        System.out.println(oldRight.node.index);
//        System.out.println(newRight.node.index);


            for (int j = 0; j < k; j++) {
                if (newLeft.node == node) break;
                if (newRight.node != oldRight.node && (newLeft.num == newLeft.node.val - 1)) {
                    long dl = (newLeft.node.next.index - newLeft.node.index);
                    long dr = (newRight.node.index - oldRight.node.index);
                    total += dl * dr;
//                if (newLeft.node.next == oldRight.node && dl != 1 && dr != 1) total--;
                }

                moveRightOne(oldRight);
                moveRightOne(newLeft);
                moveRightOne(newRight);

//            System.out.println("nodes: ");
//            System.out.println(newLeft.node.index);
//            System.out.println(oldRight.node.index);
//            System.out.println(newRight.node.index);
            }

            return total;
        }

        private void moveRightOne(Walk walk) {
            walk.num++;
            if (walk.num == walk.node.val) {
                walk.node = walk.node.next;
                walk.num = 0;
            }
        }

        private void moveLeft(Walk walk, int k) {
            while (k > 0) {
                if (walk.num == 0) {
                    walk.node = walk.node.prev;
                    walk.num = walk.node.val - 1;
                }
                else {
                    walk.num--;
                }
                k--;
            }
        }

        Node[] buildList(int left, int right, List<List<Integer>> violasByColumn) {
            Node[] nodes = new Node[R + 2];

            for (int i = left; i <= right; i++) {
                for (int viola : violasByColumn.get(i)) {
                    int v = viola + 1;
                    if (nodes[v] == null)
                        nodes[v] = new Node(v, 0);
                    nodes[v].val++;
                }
            }

            nodes[0] = new Node(0, inf);
            nodes[R + 1] = new Node(R + 1, inf);
            Node prev = nodes[0];
            for (int i = 1; i < R + 2; i++) {
                if (nodes[i] == null) continue;
                nodes[i].prev = prev;
                prev.next = nodes[i];
                prev = nodes[i];
            }

            return nodes;
        }

        class Node {
            int val;
            int index;
            Node prev;
            Node next;

            Node(int index, int val) {
                this.val = val;
                this.index = index;
            }

            public String toString() {
                return String.format("(%d, %d)", index, val);
            }

        }

        class Walk {
            Node node;
            int num;

            Walk(Node node, int num) {
                this.node = node;
                this.num = num;
            }

        }

    }

    static class InputReader {
        private static final int DEFAULT_BUFFER_SIZE = 1 << 16;
        private static final InputStream DEFAULT_STREAM = System.in;
        private int c;
        private byte[] buf;
        private int bufferSize;
        private int bufIndex;
        private int numBytesRead;
        private InputStream stream;
        private static final byte EOF = -1;
        private static final byte SPACE = 32;
        private static final byte DASH = 45;
        private char[] charBuffer;
        private static byte[] bytes = new byte[58];
        private static int[] ints = new int[58];
        private static char[] chars = new char[128];

        static {
            char ch = ' ';
            int value = 0;
            byte _byte = 0;
            for (int i = 48; i < 58; i++) bytes[i] = _byte++;
            for (int i = 48; i < 58; i++) ints[i] = value++;
            for (int i = 32; i < 128; i++) chars[i] = ch++;
        }

        public InputReader() {
            this(DEFAULT_STREAM, DEFAULT_BUFFER_SIZE);
        }

        public InputReader(int bufferSize) {
            this(DEFAULT_STREAM, bufferSize);
        }

        public InputReader(InputStream stream) {
            this(stream, DEFAULT_BUFFER_SIZE);
        }

        public InputReader(InputStream stream, int bufferSize) {
            if (stream == null || bufferSize <= 0)
                throw new IllegalArgumentException();
            buf = new byte[bufferSize];
            charBuffer = new char[128];
            this.bufferSize = bufferSize;
            this.stream = stream;
        }

        private int readJunk(int token) {

            if (numBytesRead == EOF) return EOF;

            // Seek to the first valid position index
            do {

                while (bufIndex < numBytesRead) {
                    if (buf[bufIndex] > token) return 0;
                    bufIndex++;
                }

                // reload buffer
                try {
                    numBytesRead = stream.read(buf);
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
                if (numBytesRead == EOF) return EOF;
                bufIndex = 0;

            } while (true);

        }

        public int nextInt() {
            try {
                if (readJunk(DASH - 1) == EOF) throw new IOException();
                int sgn = 1, res = 0;

                c = buf[bufIndex];
                if (c == DASH) {
                    sgn = -1;
                    bufIndex++;
                }

                do {

                    while (bufIndex < numBytesRead) {
                        if (buf[bufIndex] > SPACE) {
                            res = (res << 3) + (res << 1);
                            res += ints[buf[bufIndex++]];
                        }
                        else {
                            bufIndex++;
                            return res * sgn;
                        }
                    }

                    // Reload buffer
                    numBytesRead = stream.read(buf);
                    if (numBytesRead == EOF) return res * sgn;
                    bufIndex = 0;

                } while (true);
            }
            catch (IOException e) {
                e.printStackTrace();
                return -1;
            }

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
                outputStream)));
        }

        public OutputWriter(java.io.Writer outputStreamWriter) {
            writer = new PrintWriter(new BufferedWriter(outputStreamWriter));
        }

        public void flush() {
            writer.flush();
        }

        public void close() {
            writer.flush();
            writer.close();
        }

        public void println(long i) {
            writer.println(i);
        }

    }
}

