#include <bits/stdc++.h>
using namespace std;
int N, C, D;
pair<int, int> A[400000];
long long Z, ZO, ZOZ, O, OZ, OZO;
bool cmp(pair<int, int> a, pair<int, int> b) {
  if ((b.second < 0) ^ (a.second < 0))
    return 1LL * a.first * b.second > 1LL * b.first * a.second;
  return 1LL * a.first * b.second < 1LL * b.first * a.second;
}
bool eq(pair<int, int> a, pair<int, int> b) {
  return 1LL * a.first * b.second == 1LL * b.first * a.second;
}
bool better(int i, int j) {
  return 1LL * A[i].first * A[j].second > 1LL * A[i].second * A[j].first;
}
int main() {
  scanf("%d%d%d", &N, &C, &D);
  for (int i = 0; i < N; i++)
    scanf("%d%d", &A[i].first, &A[i].second), A[i].first -= C, A[i].second -= D;
  sort(A, A + N, cmp);
  for (int i = 0, j; i < N; i = j) {
    long long NZ = Z, NZO = ZO, NZOZ = ZOZ, NO = O, NOZ = OZ, NOZO = OZO;
    for (j = i; j < N && eq(A[i], A[j]); j++) {
      if (A[j].second < 0) {
        NOZO += OZ;
        NZO += Z;
        NO++;
      } else {
        NZOZ += ZO;
        NOZ += O;
        NZ++;
      }
    }
    Z = NZ, ZO = NZO, ZOZ = NZOZ, O = NO, OZ = NOZ, OZO = NOZO;
  }
  int L = 0, R = 0, D = 0;
  for (int i = 0; i < N; i++)
    if (A[i].second == 0) {
      if (A[i].first < 0)
        L++;
      else
        R++;
    }
  for (int i = 0; i < N; i++)
    if (A[i].second < 0) D++;
  printf("%lld\n", OZO + ZOZ - 1LL * L * R * D);
  return 0;
}
