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