#include <bits/stdc++.h>
using namespace std;
const int MAXN = 4e5;
pair<int, int> a[MAXN], b1[MAXN], b2[MAXN];
int sumPr[MAXN], sumSuf[MAXN];
bool cmp(pair<int, int> a, pair<int, int> b) {
  if (a.second == 0) return 0;
  if (b.second == 0) return 1;
  int cur = 0;
  if (a.second < 0) cur ^= 1;
  if (b.second < 0) cur ^= 1;
  long long s = a.first * 1ll * b.second;
  long long r = a.second * 1ll * b.first;
  if (s == r) return 0;
  return (s < r) ^ cur;
}
int main() {
  int n, c, d;
  long long ans = 0;
  scanf("%d%d%d", &n, &c, &d);
  for (int i = 0; (i) < (n); ++i)
    scanf("%d%d", &a[i].first, &a[i].second), a[i].first -= c, a[i].second -= d;
  sort(a, a + n, cmp);
  int last = n;
  for (int i = 0; (i) < (n); ++i)
    if (a[i].second == 0) {
      last = i;
      break;
    }
  for (int i = 0; (i) < (n); ++i) sumPr[i + 1] = sumPr[i] + (a[i].second < 0);
  for (int i = (last)-1; (i) >= 0; --i)
    sumSuf[i] = sumSuf[i + 1] + (a[i].second < 0);
  for (int i = 0; (i) < (last); ++i) {
    if (a[i].second > 0) {
      int l = 0, r = 0;
      int k = lower_bound(a, a + last, a[i], cmp) - a;
      if (k != 0) l = sumPr[k];
      k = upper_bound(a, a + last, a[i], cmp) - a;
      if (k != last) r = sumSuf[k];
      ans += l * 1ll * r;
    } else {
      int l = 0, r = 0;
      int k = lower_bound(a, a + last, a[i], cmp) - a;
      if (k != 0) l = (k - sumPr[k]);
      k = upper_bound(a, a + last, a[i], cmp) - a;
      if (k != last) r = (last - k - sumSuf[k]);
      ans += l * 1ll * r;
    }
  }
  int pos1 = 0, pos2 = 0;
  for (int i = 0; (i) < (last); ++i)
    if (a[i].second > 0)
      b1[pos1++] = a[i];
    else
      b2[pos2++] = a[i];
  long long ans1 = 0, ans2 = 0;
  for (int i = 0; (i) < (pos1); ++i) {
    int l = upper_bound(b2, b2 + pos2, b1[i], cmp) - b2;
    ans1 += pos2 - l;
  }
  for (int i = 0; (i) < (pos2); ++i) {
    int l = upper_bound(b1, b1 + pos1, b2[i], cmp) - b1;
    ans2 += pos1 - l;
  }
  for (int i = (last); (i) < (n); ++i) {
    if (a[i].first > 0) ans += ans1;
    if (a[i].first < 0) ans += ans2;
  }
  printf(
      "%lld"
      "\n",
      ans);
  return 0;
}
