#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
bool my_comp(const pair<pair<long long, long long>, int>& l,
             const pair<pair<long long, long long>, int>& r) {
  if (l.first.first * r.first.second == l.first.second * r.first.first)
    return l.second < r.second;
  return l.first.first * r.first.second < l.first.second * r.first.first;
}
int n, a, b, c, d;
vector<pair<pair<long long, long long>, int> > g;
int prevIdx[345700], nextIdx[345700];
long long cnt[345700][2], revcnt[345700][2];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> c >> d;
  for (int i = 0; i < (int)n; i++) {
    cin >> a >> b;
    a -= c;
    b -= d;
    if (a >= 0 && b >= 0)
      g.push_back(make_pair(make_pair(a, b), 0));
    else if (a < 0 && b < 0)
      g.push_back(make_pair(make_pair(-a, -b), 1));
    else if (a >= 0)
      g.push_back(make_pair(make_pair(a, -b), 2));
    else
      g.push_back(make_pair(make_pair(-a, b), 3));
  }
  sort(g.begin(), g.end(), &my_comp);
  long long prevX = g[0].first.first, prevY = g[0].first.second, idx = 0;
  int p = -1;
  for (int i = 0; i < (int)n; i++) {
    long long X = g[i].first.first, Y = g[i].first.second;
    int P = g[i].second;
    if (X * Y == 0) {
      prevIdx[i] = i;
    } else {
      if (X * prevY == Y * prevX && p / 2 == P / 2) {
        prevIdx[i] = idx;
      } else {
        prevIdx[i] = i;
        prevX = X;
        prevY = Y;
        idx = i;
        p = P;
      }
    }
  }
  prevX = g[n - 1].first.first, prevY = g[n - 1].first.second, idx = n + 1,
  p = -1;
  for (int i = n - 1; i >= 0; i--) {
    long long X = g[i].first.first, Y = g[i].first.second;
    int P = g[i].second;
    if (X * Y == 0) {
      nextIdx[i] = i + 2;
    } else {
      if (X * prevY == Y * prevX && p / 2 == P / 2) {
        nextIdx[i] = idx;
      } else {
        nextIdx[i] = i + 2;
        prevX = X;
        prevY = Y;
        idx = i + 2;
        p = P;
      }
    }
  }
  for (int i = 0; i < (int)g.size(); i++) {
    int p = g[i].second;
    long long q = g[i].first.second;
    if (q > 0) {
      if (p == 0 || p == 3)
        cnt[i + 1][0] = cnt[i][0] + 1, cnt[i + 1][1] = cnt[i][1];
      else
        cnt[i + 1][0] = cnt[i][0], cnt[i + 1][1] = cnt[i][1] + 1;
    } else
      cnt[i + 1][0] = cnt[i][0], cnt[i + 1][1] = cnt[i][1];
  }
  for (int i = g.size() - 1; i >= 0; i--) {
    int p = g[i].second;
    long long q = g[i].first.first;
    if (q > 0) {
      if (p == 0 || p == 2)
        revcnt[i + 1][0] = revcnt[i + 2][0] + 1,
                   revcnt[i + 1][1] = revcnt[i + 2][1];
      else
        revcnt[i + 1][0] = revcnt[i + 2][0],
                   revcnt[i + 1][1] = revcnt[i + 2][1] + 1;
    } else
      revcnt[i + 1][0] = revcnt[i + 2][0], revcnt[i + 1][1] = revcnt[i + 2][1];
  }
  long long ans = 0;
  for (int i = 0; i < (int)g.size(); i++) {
    int p = g[i].second;
    if (g[i].first.first * g[i].first.second == 0) continue;
    long long c1 = cnt[prevIdx[i]][0], c2 = cnt[prevIdx[i]][1],
              rc1 = revcnt[nextIdx[i]][0], rc2 = revcnt[nextIdx[i]][1];
    if (p == 0)
      ans += c2 * rc2;
    else if (p == 1)
      ans += c1 * rc1;
    else if (p == 2)
      ans += c1 * rc2;
    else if (p == 3)
      ans += c2 * rc1;
  }
  cout << ans << endl;
  return 0;
}
