#include <bits/stdc++.h>
using namespace std;
const int MAX = 1000000;
pair<long long, long long> p[MAX];
long long cross(pair<long long, long long> a, pair<long long, long long> b) {
  return a.first * b.second - a.second * b.first;
}
bool ss(pair<long long, long long> a, pair<long long, long long> b) {
  if (a > make_pair(0LL, 0LL) && b > make_pair(0LL, 0LL)) return true;
  if (a < make_pair(0LL, 0LL) && b < make_pair(0LL, 0LL)) return true;
  return false;
}
bool cmp(pair<long long, long long> a, pair<long long, long long> b) {
  if (!ss(a, b)) return (a > make_pair(0LL, 0LL) && b < make_pair(0LL, 0LL));
  if (cross(a, b) == 0) return (a < b);
  return (cross(a, b) > 0);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, c, d;
  cin >> n >> c >> d;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    a -= c;
    b -= d;
    p[i] = make_pair(a, b);
  }
  sort(p, p + n, cmp);
  for (int i = n; i < 2 * n; i++) p[i] = p[i - n];
  long long ans = 1LL * n * (n - 1) * (n - 2) / 6;
  int ptr = 0;
  for (int i = 0; i < n; i++) {
    int j = i + 1;
    while (j < n && ss(p[i], p[j]) && cross(p[i], p[j]) == 0) j++;
    ptr = max(ptr, j);
    int len3 = 0;
    while (ptr < i + n && cross(p[i], p[ptr]) >= 0) {
      if (cross(p[i], p[ptr]) == 0) len3++;
      ptr++;
    }
    int len1 = ptr - j;
    int len2 = j - i;
    if (p[i] < make_pair(0LL, 0LL)) {
      ans += 1LL * len2 * (len2 - 1) / 2 * len3;
      ans += 1LL * len3 * (len3 - 1) / 2 * len2;
    }
    ans -= 1LL * len1 * (len1 - 1) / 2 * len2;
    ans -= 1LL * len2 * (len2 - 1) / 2 * len1;
    ans -= 1LL * len2 * (len2 - 1) * (len2 - 2) / 6;
    i = j - 1;
  }
  cout << ans << "\n";
  return 0;
}
