#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 29;
const int mod = (int)1e9 + 7;
const long double eps = 1e-18;
const long double pi = atan2((long double)0, (long double)-1);
int n, m, k;
long double ang[845699];
int main() {
  int c, d;
  scanf("%d%d%d", &n, &c, &d);
  for (int i = 0; i < n; i++) {
    int r, w;
    scanf("%d%d", &r, &w);
    long double x = r - c;
    long double y = w - d;
    ang[i] = atan2(y, x);
  }
  sort(ang, ang + n);
  for (int i = 0; i < n + 3; i++) ang[n + i] = ang[i] + 2 * pi;
  int j = 0;
  long long ans = (long long)n * (n - 1) * (n - 2) / 6;
  int lo = 0, hi = 0;
  for (int i = 0; i < n; i++) {
    while (ang[j + 1] - ang[i] < pi + eps) ++j;
    while (ang[lo] - ang[i] < pi - eps) ++lo;
    while (ang[hi + 1] - ang[i] < pi + eps) ++hi;
    ans -= (long long)(j - i) * (j - i - 1) / 2;
    ans += (long long)(hi - lo) * (hi - lo + 1) / 2;
  }
  cout << ans << endl;
  return 0;
}
