#include <bits/stdc++.h>
using namespace std;
const int N = 345678 * 2 + 10;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
const double eps = 1e-10;
const int M = 1e9 + 7;
int dcmp(double first) {
  if (fabs(first) < eps) return 0;
  return first > 0 ? 1 : -1;
}
struct pp {
  double ang;
  double first, second;
};
double Cross(pp A, pp B) { return A.first * B.second - A.second * B.first; }
bool operator<(const pp& A, const pp& B) {
  if (fabs(A.ang - B.ang) < PI / 2) return dcmp(Cross(A, B)) > 0;
  return A.ang < B.ang;
}
pp xp[N], xq[N];
double a[N], b[N];
int num[N], sum[N][2];
int check(int i, int j) {
  if (fabs(b[i] - a[j]) < PI / 2) return dcmp(Cross(xp[j], xq[i]));
  return dcmp(b[i] - a[j]);
}
int main() {
  int n;
  double c, d;
  scanf("%d %lf %lf", &n, &c, &d);
  for (int i = 0; i < n; i++) {
    double first, second;
    scanf("%lf %lf", &first, &second);
    first -= c;
    second -= d;
    xp[i].ang = atan2(second, first);
    xq[i].ang = atan2(-second, -first);
    xp[i].first = first;
    xp[i].second = second;
    xq[i].first = -first;
    xq[i].second = -second;
  }
  sort(xp, xp + n);
  sort(xq, xq + n);
  for (int i = 0; i < n; i++) {
    a[i] = xp[i].ang;
    b[i] = xq[i].ang;
  }
  int n1 = 1;
  num[0] = 1;
  for (int i = 1; i < n; i++) {
    if (fabs(a[i] - a[n1 - 1]) < PI / 2 && !dcmp(Cross(xp[i], xp[n1 - 1])))
      num[n1 - 1]++;
    else {
      num[n1] = 1;
      a[n1] = a[i];
      xp[n1++] = xp[i];
    }
  }
  for (int i = n1; i < 2 * n1; i++) {
    xp[i] = xp[i - n1];
    a[i] = a[i - n1] + 2 * PI;
    num[i] = num[i - n1];
  }
  for (int i = n; i < 2 * n; i++) {
    b[i] = b[i - n] + 2 * PI;
    xq[i] = xq[i - n];
  }
  for (int i = 0, j = 0; i < 2 * n; i++) {
    while (j < 2 * n1 && check(i, j) >= 0) j++;
    sum[j][0]++;
  }
  for (int i = 0, j = 0; i < 2 * n; i++) {
    while (j < 2 * n1 && check(i, j) > 0) j++;
    sum[j][1]++;
  }
  for (int i = 1; i < 2 * n1; i++) {
    sum[i][0] += sum[i - 1][0];
    sum[i][1] += sum[i - 1][1];
  }
  long long ans = 0, tmp = 0, ds = 0;
  for (int i = 0, j = 1; i < n1; i++) {
    for (; j < 2 * n1 && dcmp(Cross(xp[i], xp[j])) > 0; j++) {
      tmp += num[j] * (sum[j][0] - sum[i][1]);
      ds += num[j];
    }
    ans += tmp * num[i];
    if (j > i + 1) {
      tmp -= num[i + 1] * (sum[i + 1][0] - sum[i][1]);
      ds -= num[i + 1];
      tmp += (sum[i][1] - sum[i + 1][1]) * ds;
    } else {
      tmp = ds = 0;
      j = i + 2;
    }
  }
  printf("%lld\n", ans / 3);
  return 0;
}
