#include <bits/stdc++.h>
using namespace std;
int N, c, d, R[400000], W[400000], r[400000], w[400000];
long long S[400000], SS[400000], T[400000];
long double ang[400000];
vector<pair<long double, pair<int, int>>> v;
bool checkpoz(int x, int y) { return 1LL * R[x] * W[y] < 1LL * R[y] * W[x]; }
int main() {
  cin >> N >> c >> d;
  for (int i = 0; i < N; ++i) {
    cin >> r[i] >> w[i];
    r[i] -= c;
    w[i] -= d;
    v.push_back(make_pair(atan2(w[i], r[i]), make_pair(1, i)));
    v.push_back(make_pair(atan2(-w[i], -r[i]), make_pair(0, i)));
  }
  sort(v.begin(), v.end());
  int cnt = 0;
  int curr = 0;
  for (int i = 0; i < v.size(); ++i) {
    if (v[i].second.first) {
      ++cnt;
    } else {
      S[curr] = cnt;
      ang[curr] = v[i].first;
      R[curr] = r[v[i].second.second];
      W[curr] = w[v[i].second.second];
      ++curr;
    }
  }
  for (int i = 0; i < v.size(); ++i) {
    v[i].second.first = 1 - v[i].second.first;
  }
  sort(v.begin(), v.end());
  cnt = 0;
  curr = 0;
  for (int i = 0; i < v.size(); ++i) {
    if (!v[i].second.first) {
      ++cnt;
    } else {
      SS[curr] = cnt;
      ++curr;
    }
  }
  T[0] = S[0];
  for (int i = 1; i < N; ++i) {
    T[i] = T[i - 1] + S[i];
  }
  long long ret = 0;
  for (int i = 0; i < N; ++i) {
    int st = i + 1;
    int dr = i + N - 1;
    int j = i;
    while (st <= dr) {
      int mij = (st + dr) / 2;
      if (checkpoz(mij % N, i)) {
        j = mij;
        st = mij + 1;
      } else {
        dr = mij - 1;
      }
    }
    st = i;
    dr = N - 1;
    int k = i;
    while (st <= dr) {
      int mij = (st + dr) / 2;
      if (ang[mij] == ang[i]) {
        k = mij;
        st = mij + 1;
      } else {
        dr = mij - 1;
      }
    }
    if (j <= k) continue;
    ret += T[j % N] - T[k] - 1LL * (j - k) * SS[k];
    if (j >= N) {
      ret += 1LL * N * (j - N + 1) + T[N - 1];
    }
  }
  cout << ret / 3 << endl;
  return 0;
}
