#include <bits/stdc++.h>
using namespace std;
int gi() {
  int a;
  scanf("%d", &a);
  return a;
}
long long gli() {
  long long a;
  scanf("%I64d", &a);
  return a;
}
bool cmp(pair<int, int>& a, pair<int, int>& b) {
  long long r1 = a.first;
  long long w1 = a.second;
  long long r2 = b.first;
  long long w2 = b.second;
  if (w1 > 0) {
    r2 *= w1;
  } else {
    r2 *= -w1;
    r1 *= -1;
  }
  if (w2 > 0) {
    r1 *= w2;
  } else {
    r1 *= -w2;
    r2 *= -1;
  }
  return r1 < r2;
}
int dff(pair<int, int>& a, pair<int, int>& b) {
  long long x = a.first;
  x *= b.second;
  long long y = b.first;
  y *= a.second;
  return x != y;
}
int main() {
  int n = gi();
  int c = gi();
  int d = gi();
  long long zp = 0, zn = 0, tp = 0, tn = 0;
  vector<pair<int, int>> v;
  for (int i = 0; i < n; i++) {
    int r = gi() - c;
    int w = gi() - d;
    if (w == 0) {
      if (r > 0)
        zp++;
      else
        zn++;
    } else {
      v.push_back(make_pair(r, w));
      if (w > 0)
        tp++;
      else
        tn++;
    }
  }
  sort(v.begin(), v.end(), cmp);
  vector<vector<pair<int, int>>> u;
  int l = v.size();
  int ul = 0;
  for (int i = 0; i < l; i++) {
    pair<int, int>& p = v[i];
    if (u.empty() || dff(u[ul - 1][0], p)) {
      u.push_back(vector<pair<int, int>>());
      ul++;
    }
    u[ul - 1].push_back(p);
  }
  long long res = 0;
  long long fp = 0, fn = 0;
  for (int i = 0; i < ul; i++) {
    vector<pair<int, int>>& v = u[i];
    int l = v.size();
    long long cn = 0, cp = 0;
    for (int j = 0; j < l; j++) {
      if (v[j].second > 0)
        cp++;
      else
        cn++;
    }
    res += fn * cp * (tn - fn - cn + zn);
    res += fp * cn * (tp - fp - cp + zp);
    fp += cp;
    fn += cn;
  }
  cout << res << endl;
  return 0;
}
