#include <bits/stdc++.h>
using namespace std;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
long long ln, lk, lm;
long long gcd1(long long x, long long y) {
  long long z = y;
  while (x % y != 0) {
    z = x % y;
    x = y;
    y = z;
  }
  return z;
}
struct Point {
  long long x, y;
  pair<long long, long long> vec;
  Point() {}
  Point(long long x, long long y) : x(x), y(y) {}
  long double arg() const { return atan2(y, x); }
  long long cross(Point b) const { return x * b.y - b.x * y; }
  int getZone() const {
    assert(x != 0 || y != 0);
    if (x <= 0 && y < 0) return 1;
    if (y < 0 || (y == 0 && x > 0)) return 2;
    if ((y > 0 && x > 0) || (x == 0 && y > 0)) return 3;
    return 4;
  }
  bool sameVec(const Point& o) {
    return (cross(o) == 0 && x * o.x >= 0 && y * o.y >= 0);
  }
  pair<long long, long long> getvec() const { return vec; }
  void setvec() {
    if (x == 0)
      vec = make_pair(0, y < 0 ? -1 : 1);
    else if (y == 0)
      vec = {x < 0 ? -1 : 1, 0};
    else {
      long long gg = gcd1(abs(x), abs(y));
      long long X = x / gg, Y = y / gg;
      vec = {X, Y};
    }
  }
  bool operator<(const Point& o) const {
    int a = getZone(), b = o.getZone();
    if (a != b) return a < b;
    long long tmp = cross(o);
    if (tmp != 0) return tmp > 0;
    return x == o.x ? y < o.y : x < o.x;
  }
  void readin() { scanf("%lld%lld", &x, &y); }
  void pp() { printf("%lld %lld\n", x, y); }
} p[345687];
map<pair<long long, long long>, int> mp;
long long c2(long long x) {
  if (x < 2) return 0;
  return x * (x - 1) / 2;
}
void fmain() {
  scanf("%d%d%d", &n, &m, &k);
  for (int(i) = 0; (i) < (int)(n); (i)++) {
    p[i].readin();
    p[i].x -= m;
    p[i].y -= k;
    p[i].setvec();
  }
  if (debug) return;
  sort(p, p + n);
  long long ans = (long long)n * (n - 1) * (n - 2) / 6;
  for (int(i) = 0; (i) < (int)(n); (i)++) mp[p[i].getvec()]++;
  for (int i = 0, j = 1; i < n; i++) {
    for (; j < n + i && p[i].cross(p[j % n]) >= 0; j++) {
      if (p[i].getvec() == p[j % n].getvec() && j >= n && j % n <= i) break;
    }
    auto key = p[i].getvec();
    int cc = j - i - 1;
    ans -= c2(cc);
    int cc1 = mp[{-key.first, -key.second}];
    assert(cc >= cc1);
    ans += c2(cc1);
  }
  printf("%lld\n", ans);
}
int main() {
  fmain();
  return 0;
}
