#include <bits/stdc++.h>
using namespace std;
int32_t gcd(int32_t a, int32_t b) {
  if (b == 0) {
    return a;
  } else {
    return gcd(b, a % b);
  }
}
struct Vector {
  int32_t x, y;
  Vector() : x(0), y(0) {}
  Vector(int32_t pX, int32_t pY) : x(pX), y(pY) {}
  void norm() {
    int32_t div = abs(gcd(x, y));
    x /= div;
    y /= div;
  }
};
int64_t cross(Vector u, Vector v) {
  return (int64_t)u.x * v.y - (int64_t)u.y * v.x;
}
Vector operator+(Vector u, Vector v) { return Vector(u.x + v.x, u.y + v.y); }
Vector operator-(Vector u) { return Vector(-u.x, -u.y); }
Vector operator-(Vector u, Vector v) { return Vector(u.x - v.x, u.y - v.y); }
bool operator==(Vector u, Vector v) { return ((u.x == v.x) && (u.y == v.y)); }
bool operator!=(Vector u, Vector v) { return not(u == v); }
bool operator<(Vector u, Vector v) {
  if ((u.y < 0) && (v.y >= 0)) {
    return false;
  } else if ((u.y >= 0) && (v.y < 0)) {
    return true;
  } else if ((u.y == 0) && (v.y == 0)) {
    return (u.x > v.x);
  } else {
    return cross(u, v) > 0;
  }
}
const int32_t MAX_N = 345700;
Vector stud[MAX_N];
int32_t studCnt;
inline int32_t itr_cycl(int32_t n) { return (n + 1 < studCnt) ? n + 1 : 0; }
inline int32_t diff(int32_t str, int32_t end) {
  return (end <= str) ? end - str + studCnt : end - str;
}
void input() {
  Vector origin;
  scanf("%i %i %i", &studCnt, &origin.x, &origin.y);
  for (int32_t i = 0; i < studCnt; i++) {
    scanf("%i %i", &stud[i].x, &stud[i].y);
    stud[i].x -= origin.x;
    stud[i].y -= origin.y;
    stud[i].norm();
  }
}
int32_t main() {
  input();
  sort(stud, stud + studCnt);
  int32_t endInd = 0;
  int32_t hplaneEnd = 0;
  int32_t endEq = 0;
  int32_t curEq = 0;
  int64_t colinTrip = 0;
  int64_t hplaneTrip = 0;
  for (int32_t i = 0; i < studCnt; i++) {
    curEq--;
    if (curEq < 1) {
      curEq = 1;
      for (int32_t j = itr_cycl(i); stud[i] == stud[j]; j = itr_cycl(j)) {
        curEq++;
      }
      Vector opp = -stud[i];
      while (stud[endInd] == stud[i]) {
        endInd = itr_cycl(endInd);
      }
      for (; cross(stud[endInd], opp) > 0; endInd = itr_cycl(endInd)) {
      }
      hplaneEnd = endInd;
      endEq = 0;
      for (; stud[endInd] == opp; endInd = itr_cycl(endInd)) {
        endEq++;
      }
      int64_t colinear = curEq + endEq;
      colinTrip += (int64_t)curEq * (curEq - 1) * (curEq - 2) / 6;
      colinTrip += (int64_t)curEq * (curEq - 1) * endEq / 2;
    }
    int64_t hplaneEqCnt = hplaneEnd - curEq - i;
    if (hplaneEnd <= i) {
      hplaneEqCnt += studCnt;
    }
    hplaneTrip += hplaneEqCnt * (hplaneEqCnt - 1) / 2;
    hplaneTrip += hplaneEqCnt * (curEq - 1);
    hplaneTrip += endEq * hplaneEqCnt;
  }
  int64_t allPossib = (int64_t)studCnt * (studCnt - 1) / 2 * (studCnt - 2) / 3;
  int64_t awns = allPossib - hplaneTrip - colinTrip;
  printf("%lli\n", awns);
}
