#include <bits/stdc++.h>
using namespace std;
const int N = 350000;
struct P {
  int x, y;
  P() {}
  P(int _x, int _y) {
    x = _x;
    y = _y;
  }
  bool be() const { return x ? x > 0 : y > 0; }
  P operator+(const P &a) const { return P(x + a.x, y + a.y); }
  P operator-(const P &a) const { return P(x - a.x, y - a.y); }
  long long operator*(const P &a) const {
    return 1ll * x * a.y - 1ll * y * a.x;
  }
  bool operator==(const P &a) const {
    return 1ll * x * a.y == 1ll * y * a.x && be() == a.be();
  }
} p[N * 2];
long long ans, SSS[N * 2];
int n, PX, PY;
int S[N * 2], SS[N * 2];
bool cmp(P x, P y) { return x.be() ^ y.be() ? x.be() : x * y > 0; }
int main() {
  scanf("%d%d%d", &n, &PX, &PY);
  for (int i = (int)(1); i <= (int)(n); i++) {
    scanf("%d%d", &p[i].x, &p[i].y);
    p[i].x -= PX;
    p[i].y -= PY;
  }
  sort(p + 1, p + n + 1, cmp);
  int top = 1;
  S[1] = 1;
  for (int i = (int)(2); i <= (int)(n); i++) {
    if (!(p[i] == p[i - 1])) p[++top] = p[i];
    ++S[top];
  }
  n = top;
  for (int i = (int)(1); i <= (int)(n); i++) {
    p[i + n] = p[i];
    S[i + n] = S[i];
  }
  for (int i = (int)(1); i <= (int)(n * 2); i++) {
    SS[i] = SS[i - 1] + S[i];
    SSS[i] = SSS[i - 1] + 1ll * S[i] * S[i];
  }
  for (int i = (int)(1); i <= (int)(n); i++)
    ans += 1ll * S[i] * (1ll * SS[i - 1] * SS[i - 1] - SSS[i - 1]) / 2;
  int p1 = 1;
  for (int i = (int)(1); i <= (int)(n); i++) {
    p1 = max(p1, i);
    for (; p1 + 1 != i + n && p[i] * p[p1 + 1] >= 0; ++p1)
      ;
    ans -= 1ll * S[i] *
           (1ll * (SS[p1] - SS[i]) * (SS[p1] - SS[i]) - (SSS[p1] - SSS[i])) / 2;
  }
  printf("%lld\n", ans);
}
