#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool blt(pair<int, int> l, pair<int, int> r) {
  return 1LL * l.first * r.second < 1LL * r.first * l.second;
}
long long ntris(vector<pair<int, int> > &larr, vector<pair<int, int> > &rarr) {
  int b = 0, e = 0;
  long long ret = 0;
  for (int i = 0; i < larr.size(); i++) {
    while (b < rarr.size() && blt(rarr[b], larr[i])) b++;
    while (e < rarr.size() && !(blt(larr[i], rarr[e]))) e++;
    ret += 1LL * b * (rarr.size() - e);
  }
  return ret;
}
int n, c, d, p1, p2;
vector<pair<int, int> > neg, pos;
int main() {
  cin.sync_with_stdio(false);
  cin >> n >> c >> d;
  for (int i = 0; i < n; i++) {
    cin >> p1 >> p2;
    p1 -= c;
    p2 -= d;
    int g = gcd(abs(p1), abs(p2));
    p1 /= g;
    p2 /= g;
    if (p2 > 0 || (p2 == 0 && p1 > 0))
      pos.push_back(make_pair(p1, p2));
    else
      neg.push_back(make_pair(-p1, -p2));
  }
  sort(pos.begin(), pos.end(), blt);
  sort(neg.begin(), neg.end(), blt);
  cout << ntris(pos, neg) + ntris(neg, pos) << '\n';
  return 0;
}
