#include <bits/stdc++.h>
using namespace std;
struct PT {
  int x, y;
  PT(int x = 0, int y = 0) : x(x), y(y) {}
  void in() { scanf("%d%d", &x, &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); }
  long long operator*(const PT &p) const {
    return 1LL * x * p.y - 1LL * y * p.x;
  }
};
bool cmp(PT a, PT b) {
  if (a.y >= 0 && b.y < 0) return 1;
  if (a.y < 0 && b.y >= 0) return 0;
  if (a.y == 0 && b.y == 0) {
    if (a.x >= 0 && b.x < 0)
      return 1;
    else
      return 0;
  }
  return a * b > 0;
}
const int N = 440000;
int n;
PT A, B[N + N];
int main() {
  scanf("%d", &n);
  A.in();
  for (int i = 0; i < n; i++) {
    B[i].in();
    B[i] = B[i] - A;
  }
  sort(B, B + n, cmp);
  for (int i = n; i < n + n; i++) B[i] = B[i - n];
  long long ans = 0;
  int j = 0, pr = 0;
  for (int i = 0; i < n; i++) {
    if (B[i] * B[pr] != 0 || (B[i] * B[pr] == 0 && 1LL * B[i].x * B[j].x <= 0 &&
                              1LL * B[i].y * B[j].y <= 0))
      pr = i;
    while (B[i] * B[j] >= 0 && j < pr + n) j++;
    int cnt = j - i;
    ans += 1LL * (cnt - 1) * (cnt - 2) / 2;
  }
  j = 0;
  while (j < n) {
    int i = j;
    while (j < n && B[i] * B[j] == 0 && 1LL * B[i].x * B[j].x >= 0 &&
           1LL * B[i].y * B[j].y >= 0)
      ++j;
    int cnt = j - i;
    ans += 1LL * cnt * (cnt - 1) * (cnt - 2) / 6;
  }
  for (int i = 0; i < n; i++) {
    if (B[i].x < 0 || (B[i].x == 0 && B[i].y < 0)) B[i] = PT(-B[i].x, -B[i].y);
  }
  sort(B, B + n, cmp);
  int i = 0;
  while (i < n) {
    int j = i;
    while (i < n && B[i] * B[j] == 0) ++i;
    int cnt = i - j;
    ans -= 1LL * cnt * (cnt - 1) * (cnt - 2) / 6;
  }
  cout << 1LL * n * (n - 1) * (n - 2) / 6 - ans << endl;
}
