#include <bits/stdc++.h>
using namespace std;
const int nm = 350000;
struct bg {
  long long r, w;
  bool operator<(bg that) const {
    if (w * that.w > 0) {
      return r * that.w < that.r * w;
    }
    if (w * that.w < 0) {
      return r * that.w > that.r * w;
    }
    if (w == 0) {
      if (that.w == 0) {
        if (r > 0) {
          return 0;
        }
        if (that.r < 0) return 0;
        return 1;
      }
      if (r > 0) return 0;
      return 1;
    }
    if (that.w == 0) {
      if (that.r > 0) return 1;
      return 0;
    }
    return 0;
  }
  bg() {}
  bg(long long _r, long long _w) {
    r = _r;
    w = _w;
  }
};
int n;
bg a[nm];
long long c, d;
vector<bg> be, to, khong;
int main() {
  scanf("%d%I64d%I64d", &n, &c, &d);
  for (int i = 1; i <= n; ++i) {
    scanf("%I64d%I64d", &a[i].r, &a[i].w);
    a[i].r -= c;
    a[i].w -= d;
    if (a[i].w < 0)
      be.push_back(a[i]);
    else if (a[i].w > 0)
      to.push_back(a[i]);
    else
      khong.push_back(a[i]);
  }
  sort(be.begin(), be.end());
  sort(to.begin(), to.end());
  sort(khong.begin(), khong.end());
  long long res = 0;
  int j = -1, k = 0;
  int nto = to.size(), nbe = be.size(), nkhong = khong.size();
  for (int i = 0; i < nbe; ++i) {
    while (j + 1 < nto && to[j + 1] < be[i]) j++;
    while (k < nto && !(be[i] < to[k])) k++;
    res += (long long)(j + 1) * (long long)(nto - k);
  }
  j = -1;
  k = 0;
  for (int i = 0; i < nto; ++i) {
    while (j + 1 < nbe && be[j + 1] < to[i]) j++;
    while (k < nbe && !(to[i] < be[k])) k++;
    res += (long long)(j + 1) * (long long)(nbe - k);
  }
  j = -1;
  k = 0;
  for (int i = 0; i < nbe; ++i) {
    while (j + 1 < nkhong && khong[j + 1] < be[i]) j++;
    while (k < nto && !(be[i] < to[k])) k++;
    res += (long long)(j + 1) * (long long)(nto - k);
  }
  j = -1;
  k = 0;
  for (int i = 0; i < nbe; ++i) {
    while (j + 1 < nto && to[j + 1] < be[i]) j++;
    while (k < nkhong && !(be[i] < khong[k])) k++;
    res += (long long)(j + 1) * (long long)(nkhong - k);
  }
  printf("%I64d\n", res);
}
