#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
struct PT {
  long long x, y;
  PT() {}
  PT(long long x, long long y) : x(x), y(y) {}
  PT(const PT &p) : x(p.x), y(p.y) {}
  PT operator+(const PT &p) const { return PT(x + p.x, y + p.y); }
  PT operator-(const PT &p) const { return PT(x - p.x, y - p.y); }
  PT operator*(long long c) const { return PT(x * c, y * c); }
  PT operator/(long long c) const { return PT(x / c, y / c); }
  bool operator<(const PT &p) const {
    return make_pair(x, y) < make_pair(p.x, p.y);
  }
  bool operator==(const PT &p) const { return !(*this < p) && !(p < *this); }
};
long long dot(PT p, PT q) { return p.x * q.x + p.y * q.y; }
long long dist2(PT p, PT q) { return dot(p - q, p - q); }
long long cross(PT p, PT q) { return p.x * q.y - p.y * q.x; }
PT norm(PT x, long long l) { return x * sqrt(l * l / dot(x, x)); }
istream &operator>>(istream &is, PT &p) { return is >> p.x >> p.y; }
ostream &operator<<(ostream &os, const PT &p) {
  return os << "(" << p.x << "," << p.y << ")";
}
PT center;
bool cmp(PT a, PT b) {
  if (a.x == center.x && a.y == center.y) return false;
  if (b.x == center.x && b.y == center.y) return true;
  if (a.x >= center.x && b.x < center.x) return true;
  if (a.x < center.x && b.x >= center.x) return false;
  if (a.x - center.x == 0 && b.x - center.x == 0) {
    if (a.y - center.y >= 0 || b.y - center.y >= 0) return a.y > b.y;
    return b.y > a.y;
  }
  return cross(a - center, b - center) < 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  long long c, d;
  cin >> N >> c >> d;
  vector<PT> v(N);
  vector<int> en(N << 1);
  for (int i = 0; i < N; i++) cin >> v[i], v[i].x -= c, v[i].y -= d;
  center = {0, 0};
  sort(v.begin(), v.end(), cmp);
  for (int i = 0; i < N; i++) v.push_back(v[i]);
  for (int i = 0, k = 0; i < N;) {
    int j = i;
    while (j < N && cross(v[i], v[j]) == 0 &&
           min(dot(v[j], v[i]), dot(v[i], v[j])) > 0)
      j++;
    k = max(k, j);
    while (k < (N << 1) && cross(v[i], v[k]) < 0) k++;
    for (; i < j; i++) en[i] = k - 1, en[i + N] = k - 1 + N;
  }
  long long sum2 = 0;
  long long sum1 = 0;
  long long res = 0;
  for (int i = 0, k = 0, j = 0, s = 0; i < N; i = j) {
    j = i;
    while (k <= en[i]) {
      sum2 += en[k] + 1;
      sum1++;
      k++;
    }
    while (j < N && cross(v[i], v[j]) == 0 &&
           min(dot(v[j], v[i]), dot(v[i], v[j])) > 0) {
      j++;
    }
    while (s < j) {
      sum1--;
      sum2 -= en[s] + 1;
      s++;
    }
    int ref = en[i] + 1;
    while (cross(v[ref], v[i]) == 0 &&
           min(dot(v[ref], v[i]), dot(v[i], v[ref])) < 0)
      ref++;
    while (en[s] < ref) {
      sum1--;
      sum2 -= en[s] + 1;
      s++;
    }
    res += (j - i) * (sum2 - sum1 * ref);
  }
  assert(res % 3 == 0);
  cout << res / 3 << '\n';
  return 0;
}
