#include <bits/stdc++.h>
using namespace std;
const long double pi = acos((long double)-1), eps = 1e-18;
int main() {
  long long n, c, d;
  cin >> n >> c >> d;
  vector<long double> ang;
  for (int i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    x -= c;
    y -= d;
    long double cur = atan2(y, x);
    ang.push_back(cur);
    ang.push_back(cur + 2 * pi);
  }
  sort(ang.begin(), ang.end());
  long long ans = (n * (n - 1) * (n - 2)) / 6;
  for (long long i = 0, lo = 0, hi = 0; i < n; i++) {
    while (ang[lo] < ang[i] + pi - eps) lo++;
    while (ang[hi + 1] < ang[i] + pi + eps) hi++;
    ans -= ((hi - i) * (hi - i - 1)) / 2;
    ans += ((hi - lo) * (hi - lo + 1)) / 2;
  }
  cout << ans << "\n";
  return 0;
}
