#include <bits/stdc++.h>
using namespace std;
template <typename TH>
void _dbg(const char* sdbg, TH h) {
  cerr << sdbg << "=" << h << "\n";
}
template <typename TH, typename... TA>
void _dbg(const char* sdbg, TH h, TA... t) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << "=" << h << ",";
  _dbg(sdbg + 1, t...);
}
const int maxn = 4e5 + 5;
const long double pi = acos((long double)-1);
const long double esp = 1e-18;
pair<int, int> a[maxn];
int n;
long double v[maxn * 2];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if (fopen("TEST"
            ".INP",
            "r"))
    freopen(
        "TEST"
        ".INP",
        "r", stdin),
        freopen(
            "TEST"
            ".OUT",
            "w", stdout);
  cin >> n;
  cin >> a[n].first >> a[n].second;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first >> a[i].second;
    a[i].first -= a[n].first;
    a[i].second -= a[n].second;
    long double now = atan2((long double)a[i].second, (long double)a[i].first);
    (now);
    v[i] = now;
  }
  long long res = 1ll * n * (n - 1) * (n - 2) / 6;
  sort(v, v + n);
  for (int i = 0; i < n; ++i) v[i + n] = v[i] + 2 * pi;
  int j = 0, k = 0;
  v[2 * n] = 1000;
  for (int i = 0; i < n; ++i) {
    (v[i]);
    while (v[j] < v[i] + pi - esp) ++j;
    while (v[k + 1] < v[i] + pi + esp) ++k;
    (i, j, k);
    ((long long)(k - j) * (k - j - 1) / 2,
     (long long)(k - i - 1) * (k - i - 2) / 2);
    res += (long long)(k - j + 1) * (k - j) / 2;
    res -= (long long)(k - i) * (k - i - 1) / 2;
  }
  cout << res;
}
