#include <bits/stdc++.h>
using namespace std;
bool eq(pair<long long, long long> x, pair<long long, long long> y) {
  long long a = x.first;
  long long b = x.second;
  long long c = y.first;
  long long d = y.second;
  return a * d == b * c;
}
bool cmp(pair<long long, long long> x, pair<long long, long long> y) {
  long long a = x.first;
  long long b = x.second;
  long long c = y.first;
  long long d = y.second;
  long long bd = b * d;
  if (bd > 0) {
    return a * d < b * c;
  } else if (bd < 0) {
    return a * d > b * c;
  } else {
    assert(false);
  }
}
bool cmpe(pair<long long, long long> x, pair<long long, long long> y) {
  return eq(x, y) || cmp(x, y);
}
long long go(vector<pair<long long, long long> > a,
             vector<pair<long long, long long> > b, long long negzero) {
  long long n = a.size();
  long long m = b.size();
  long long *f = new long long[m];
  long long *g = new long long[n];
  for (long long i = 0; i < m; i++) f[i] = 0;
  for (long long i = 0; i < n; i++) g[i] = 0;
  long long i = m - 1;
  long long k = n - 1;
  long long p = 0;
  while (i >= 0 && k >= 0) {
    while (i >= 0 && k >= 0 && cmp(b[i], a[k])) {
      p++;
      k--;
    }
    while (i >= 0 && k >= 0 && cmpe(a[k], b[i])) {
      f[i] = p;
      i--;
    }
  }
  while (i >= 0) {
    f[i] = p;
    i--;
  }
  long long q = 0;
  i = n - 1;
  k = m - 1;
  while (i >= 0 && k >= 0) {
    while (i >= 0 && k >= 0 && cmp(a[i], b[k])) {
      q += f[k];
      k--;
    }
    while (i >= 0 && k >= 0 && cmpe(b[k], a[i])) {
      g[i] = q;
      i--;
    }
  }
  while (i >= 0) {
    g[i] = q;
    i--;
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    ans += g[i];
  }
  long long s = 0;
  for (long long i = 0; i < m; i++) {
    s += f[i];
  }
  ans += s * negzero;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  long long n, c, d;
  cin >> n;
  cin >> c;
  cin >> d;
  vector<pair<long long, long long> > a, b;
  long long poszero = 0;
  long long negzero = 0;
  for (long long i = 0; i < n; i++) {
    long long r, w;
    cin >> r;
    cin >> w;
    r -= c;
    w -= d;
    if (r == 0 && w == 0) continue;
    if (w == 0) {
      if (r > 0) poszero++;
      if (r < 0) negzero++;
      continue;
    }
    if (w > 0) {
      a.push_back(make_pair(r, w));
    } else {
      b.push_back(make_pair(r, w));
    }
  }
  sort(a.begin(), a.end(), cmp);
  sort(b.begin(), b.end(), cmp);
  long long ans1 = go(a, b, negzero);
  long long ans2 = go(b, a, poszero);
  long long ans = ans1 + ans2;
  cout << ans << endl;
}
