#include <bits/stdc++.h>
using namespace std;
const int MN = 800111;
int n;
long double a[MN];
long long c2(long long n) { return n * (n - 1) / 2ll; }
long long c3(long long n) { return n * (n - 1) * (n - 2) / 6ll; }
const long double PI = atan2((long double)0.0, (long double)-1.0);
const long double EPS = 1e-18;
int main() {
  ios ::sync_with_stdio(false);
  int c, d;
  while (scanf("%d%d%d", &n, &c, &d) == 3) {
    for (int i = (1), _b = (n); i <= _b; i++) {
      int x, y;
      scanf("%d%d", &x, &y);
      a[i] = atan2(y - d, x - c);
    }
    sort(a + 1, a + n + 1);
    long long res = c3(n);
    for (int i = (n + 1), _b = (n + n + 3); i <= _b; i++) {
      a[i] = a[i - n];
      a[i] += 2 * PI;
    }
    int j = 1, l = 1, r = 1;
    for (int i = (1), _b = (n); i <= _b; i++) {
      while (a[j + 1] - a[i] < PI + EPS) ++j;
      while (a[l] - a[i] < PI - EPS) ++l;
      while (a[r + 1] - a[i] < PI + EPS) ++r;
      res -= c2(j - i);
      res += c2(r - l + 1);
    }
    cout << res << endl;
  }
}
