#include <bits/stdc++.h>
using namespace std;
const int maxn = 350 * 1000 + 10;
complex<long long> p[maxn], tmp;
int piv, n, c, d, x, y, l1, r1, l2, r2;
long long kam, ziy, ted;
long long cr(complex<long long> a, complex<long long> b) {
  return (conj(a) * b).imag();
}
bool acmp(complex<long long> a, complex<long long> b) { return cr(a, b) > 0; }
bool pcmp(complex<long long> &a) {
  return a.imag() < 0 || (a.imag() == 0 && a.real() < 0);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> c >> d;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    p[i] = {x - c, y - d};
  }
  auto pivot = partition(p, p + n, pcmp);
  piv = pivot - p;
  sort(p, pivot, acmp);
  sort(pivot, p + n, acmp);
  for (int i = 0; i < piv; i++) {
    l1 = lower_bound(p, pivot, p[i], acmp) - p;
    r1 = upper_bound(p, pivot, p[i], acmp) - p;
    tmp = {-p[i].real(), -p[i].imag()};
    l2 = lower_bound(pivot, p + n, tmp, acmp) - p;
    r2 = upper_bound(pivot, p + n, tmp, acmp) - p;
    ted = r2 - i - 1;
    kam += ted * (ted - 1) / 2;
    if (i == l1) ziy += (long long)(r1 - l1) * (r1 - l1 - 1) / 2 * (r2 - l2);
  }
  for (int i = piv; i < n; i++) {
    l1 = lower_bound(pivot, p + n, p[i], acmp) - p;
    r1 = upper_bound(pivot, p + n, p[i], acmp) - p;
    tmp = {-p[i].real(), -p[i].imag()};
    l2 = lower_bound(p, pivot, tmp, acmp) - p;
    r2 = upper_bound(p, pivot, tmp, acmp) - p;
    ted = n - i + r2 - 1;
    kam += ted * (ted - 1) / 2;
    if (i == l1) ziy += (long long)(r1 - l1) * (r1 - l1 - 1) / 2 * (r2 - l2);
  }
  cout << (long long)n * (n - 1) * (n - 2) / 6 - kam + ziy;
  return 0;
}
