#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
template <class T>
typename T::value_type arr_sum(const T &v, int n) {
  typename T::value_type sum = 0;
  for (int i = (0); i < (n); ++i) sum += v[i];
  return sum;
}
struct Sync_stdio {
  Sync_stdio() {
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
  }
} _sync_stdio;
int sign(int x) { return x > 0 ? 1 : x == 0 ? 0 : -1; }
int f1(const pair<long long, long long> &a,
       const pair<long long, long long> &b) {
  return sign(a.second) * a.first * abs(b.second) <
         sign(b.second) * abs(a.second) * b.first;
}
int main() {
  int n, c, d;
  cin >> n >> c >> d;
  vector<pair<long long, long long>> v(n);
  for (int i = (0); i < (n); ++i) {
    cin >> v[i].first >> v[i].second;
    v[i].first -= c;
    v[i].second -= d;
  }
  vector<pair<long long, long long>> v1;
  vector<pair<long long, long long>> v2;
  for (auto i : v) {
    if (i.second < 0) {
      v1.push_back(i);
    } else if (i.second > 0) {
      v2.push_back(i);
    }
  }
  sort(v1.begin(), v1.end(), f1);
  sort(v2.begin(), v2.end(), f1);
  long long res = 0;
  for (auto i : v1) {
    long long pos1 = lower_bound(v2.begin(), v2.end(), i, f1) - v2.begin();
    long long pos2 = upper_bound(v2.begin(), v2.end(), i, f1) - v2.begin();
    res += pos1 * (v2.size() - pos2);
  }
  for (auto i : v2) {
    long long pos1 = lower_bound(v1.begin(), v1.end(), i, f1) - v1.begin();
    long long pos2 = upper_bound(v1.begin(), v1.end(), i, f1) - v1.begin();
    res += pos1 * (v1.size() - pos2);
  }
  long long res1 = 0;
  long long res2 = 0;
  for (auto i : v1) {
    int pos = lower_bound(v2.begin(), v2.end(), i, f1) - v2.begin();
    res1 += pos;
  }
  for (auto i : v2) {
    int pos = lower_bound(v1.begin(), v1.end(), i, f1) - v1.begin();
    res2 += pos;
  }
  for (auto i : v) {
    if (i.second == 0) {
      if (i.first > 0) {
        res += res1;
      } else {
        res += res2;
      }
    }
  }
  cout << res;
}
