#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-18;
long long getint() {
  long long _x = 0, _tmp = 1;
  char _tc = getchar();
  while ((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
  if (_tc == '-') _tc = getchar(), _tmp = -1;
  while (_tc >= '0' && _tc <= '9') _x *= 10, _x += (_tc - '0'), _tc = getchar();
  return _x * _tmp;
}
long long mypow(long long _a, long long _x, long long _mod) {
  if (_x == 0) return 1ll;
  long long _tmp = mypow(_a, _x / 2, _mod);
  _tmp = (_tmp * _tmp) % _mod;
  if (_x & 1) _tmp = (_tmp * _a) % _mod;
  return _tmp;
}
bool equal(long double _x, long double _y) {
  return _x > _y - eps && _x < _y + eps;
}
int __ = 1, cs;
const long double pi = atan2((long double)0, (long double)-1);
long double a[3456789];
void build() {}
long long n, c, d;
void init() {
  n = getint();
  c = getint();
  d = getint();
  for (int i = 0; i < n; i++) {
    long double ri = getint() - c;
    long double wi = getint() - d;
    a[i] = atan2(wi, ri);
  }
  sort(a, a + n);
  for (int i = 0; i < n + n; i++) a[i + n] = a[i] + 2.0 * pi;
}
void solve() {
  long long ans = n * (n - 1) * (n - 2) / 6;
  long long l = 0, r = 0;
  for (long long i = 0; i < n; i++) {
    while (a[l] - a[i] < pi - eps) l++;
    while (a[r + 1] - a[i] < pi + eps) r++;
    ans -= (r - i) * (r - i - 1) / 2;
    ans += (r - l) * (r - l + 1) / 2;
  }
  cout << ans << endl;
}
int main() {
  build();
  while (__--) {
    init();
    solve();
  }
}
