BCPC stands for Byteforces Collegiate Programming Contest, and is the most famous competition in Byteforces.

BCPC is a team competition. Each team is composed by a coach and three contestants. Blenda is the coach of the Bit State University(BSU), and she is very strict selecting the members of her team.

<image>

In BSU there are n students numbered from 1 to n. Since all BSU students are infinitely smart, the only important parameters for Blenda are their reading and writing speed. After a careful measuring, Blenda have found that the i-th student have a reading speed equal to ri (words per minute), and a writing speed of wi (symbols per minute). Since BSU students are very smart, the measured speeds are sometimes very big and Blenda have decided to subtract some constant value c from all the values of reading speed and some value d from all the values of writing speed. Therefore she considers ri' = ri - c and wi' = wi - d. 

The student i is said to overwhelm the student j if and only if ri'·wj' > rj'·wi'. Blenda doesn’t like fights in teams, so she thinks that a team consisting of three distinct students i, j and k is good if i overwhelms j, j overwhelms k, and k overwhelms i. Yes, the relation of overwhelming is not transitive as it often happens in real life.

Since Blenda is busy preparing a training camp in Codeforces, you are given a task to calculate the number of different good teams in BSU. Two teams are considered to be different if there is at least one student that is present in one team but is not present in the other. In other words, two teams are different if the sets of students that form these teams are different.

Input

In the first line of the input three integers n, c and d (3 ≤ n ≤ 345678, 1 ≤ c, d ≤ 109) are written. They denote the number of students Blenda can use to form teams, the value subtracted from all reading speeds and the value subtracted from all writing speeds respectively.

Each of the next n lines contains two integers ri and wi (0 < ri, wi ≤ 109, |ri - c| + |wi - d| > 0). There are no two students, such that both their reading and writing speeds coincide, i.e. for every i ≠ j condition |ri - rj| + |wi - wj| > 0 holds.

Output

Print the number of different teams in BSU, that are good according to Blenda's definition.

Examples

Input

5 2 2
1 1
4 1
2 3
3 2
3 4


Output

4


Input

7 6 6
3 2
1 7
5 7
3 7
6 4
8 9
8 5


Output

11

Note

In the first sample the following teams are good: (i = 1, j = 2, k = 3), (i = 2, j = 5, k = 1), (i = 1, j = 4, k = 3), (i = 5, j = 1, k = 4).

Note, that for example the team (i = 3, j = 1, k = 2) is also good, but is considered to be the same as the team (i = 1, j = 2, k = 3).
import java.util.Arrays;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;

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

class TaskE {

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.nextInt();
        long c = in.nextLong();
        long d = in.nextLong();

        Vector[] vectors = new Vector[2 * n];
        for (int i = 0; i < n; i++) {
            long x = in.nextInt();
            long y = in.nextInt();

            vectors[i] = new Vector(x - c, y - d);
        }

        Arrays.sort(vectors, 0, n);

        for (int i = 0; i < n; i++) {
            vectors[i + n] = new Vector(vectors[i].x, vectors[i].y, 0, 1);
        }

        long res = (long) n * (n - 1) * (n - 2) / 6;

        int lo = 0;
        int hi = 0;
        for (int i = 0; i < n; i++) {
            while (isLowerThanNegative(i, lo, vectors)) {
                lo++;
            }
            while (isLowerOrEqThanNegative(i, hi + 1, vectors)) {
                hi++;
            }
            res -= (hi - i) * (hi - i - 1L) / 2;
            res += (hi - lo + 1) * (hi - lo) / 2;
        }

        out.println(res);
    }

    private boolean isLowerThanNegative(int i, int lo, Vector[] vectors) {
        int prodSign = vectors[i].vectorProdSign(vectors[lo]);
        boolean result;
        result = prodSign > 0 || prodSign == 0 && vectors[i].side == vectors[lo].side && vectors[i].partNum == vectors[lo].partNum;
        return result;
    }

    private boolean isLowerOrEqThanNegative(int i, int hi, Vector[] vectors) {
        int prodSign = vectors[i].vectorProdSign(vectors[hi]);
        boolean result;
        result = prodSign > 0 || prodSign == 0 && (vectors[i].side != vectors[hi].side || vectors[i].partNum == vectors[hi].partNum);
        return result;
    }


    private static class Vector implements Comparable<Vector> {
        long x;
        long y;
        int side;
        int id;
        int partNum;

        public Vector(long x, long y) {
            this(x, y, 0);
        }

        public Vector(long x, long y, int id) {
            this(x, y, id, 0);
        }

        public Vector(long x, long y, int id, int partNum) {
            this.x = x;
            this.y = y;

            if (y != 0) {
                side = y > 0 ? -1 : 1;
            } else {
                side = x > 0 ? -1 : 1;
            }

            this.id = id;
            this.partNum = partNum;
        }

        public int vectorProdSign(Vector o) {
            return Long.signum(x * o.y - y * o.x);
        }

        public boolean isLower(Vector o) {
            return x * x + y * y < o.x * o.x + o.y * o.y;
        }

        public int compareTo(Vector o) {
            if (x == o.x && y == o.y) {
                return 0;
            }

            if (side != o.side) {
                return Integer.compare(side, o.side);
            } else {
                int res = -vectorProdSign(o);
                if (res != 0) {
                    return res;
                } else if (isLower(o)) {
                    return -1;
                } else if (o.isLower(this)) {
                    return 1;
                } else {
                    throw new RuntimeException();
                }
            }
        }
    }

}

class InputReader {
    private BufferedReader reader;
    private String[] currentArray;
    private int curPointer;

    public InputReader(InputStream inputStream) {
        reader = new BufferedReader(new InputStreamReader(inputStream));
    }


    public int nextInt() {
        if ((currentArray == null) || (curPointer >= currentArray.length)) {
            try {
                currentArray = reader.readLine().split(" ");
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            curPointer = 0;
        }
        return Integer.parseInt(currentArray[curPointer++]);
    }

    public long nextLong() {
        if ((currentArray == null) || (curPointer >= currentArray.length)) {
            try {
                currentArray = reader.readLine().split(" ");
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            curPointer = 0;
        }
        return Long.parseLong(currentArray[curPointer++]);
    }

}

