import scala.collection.mutable
import scala.io.StdIn._

object Main extends App {

  val Array(n, a, b) = readLine.trim.split(' ').map(_.toInt)
  val pairs = Array.tabulate(n){_ ⇒
    val Array(a, b) = readLine.trim.split(' ').map(_.toInt)
    (a, b)
  }
  val (removable, rest) = pairs.partition{case (ai, bi) ⇒ math.abs(ai - bi) <= a || (b to 2 * a).contains(math.abs(ai - bi))}

  val (positive, negative) = rest.partition{case (ai, bi) ⇒ ai > bi}
  println(calMaxFlow(makeNetwork(positive, negative)) + removable.length)
  def makeNetwork(positive: Array[(Int, Int)], negative: Array[(Int, Int)]): Array[List[Edge]] = {
    val node = Array.fill(positive.length + negative.length + 2){Nil: List[Edge]}
    val source = 0
    val sink = node.length - 1
    for (i ← positive.indices) {
      node(source) ::= Edge(i + 1, 1)
      node(i + 1) ::= Edge(source, 0)
      node(source).head.pair = node(i + 1).head
      node(i + 1).head.pair = node(source).head
      for (j ← negative.indices if math.abs(positive(i)._1 + negative(j)._1 - positive(i)._2 - negative(j)._2) <= a || (b to 2 * a).contains(math.abs(positive(i)._1 + negative(j)._1 - positive(i)._2 - negative(j)._2))) {
        node(i + 1) ::= Edge(j + positive.length + 1, 1)
        node(j + positive.length + 1) ::= Edge(i + 1, 0)
        node(i + 1).head.pair = node(j + positive.length + 1).head
        node(j + positive.length + 1).head.pair = node(i + 1).head
      }
    }
    for (j ← negative.indices) {
      node(sink) ::= Edge(j + positive.length + 1, 0)
      node(j + positive.length + 1) ::= Edge(sink, 1)
      node(sink).head.pair = node(j + positive.length + 1).head
      node(j + positive.length + 1).head.pair = node(sink).head
    }
    node
  }
  def calMaxFlow(nodes: Array[List[Edge]]): Int = {
    val depth = Array.fill(nodes.length){0}
    val searching = Array.tabulate(nodes.length)(nodes)
    def bfs(): Unit = {
      val queue = mutable.Queue[Int]()
      for (i ← nodes.indices) {
        depth(i) = -1
        searching(i) = nodes(i)
      }
      depth(0) = 0
      queue.enqueue(0)
      while(queue.nonEmpty) {
        val current = queue.dequeue()
        if (current != nodes.length - 1) for (edge ← nodes(current) if edge.flow > 0 && depth(edge.to) == -1) {
          depth(edge.to) = depth(current) + 1
          queue.enqueue(edge.to)
        }
      }
    }
    def dfs(current: Int): Boolean = {
      if (current == nodes.length - 1) true
      else {
        var result = false
        while (!result && searching(current).nonEmpty) {
          if (searching(current).head.flow > 0 && depth(current) < depth(searching(current).head.to) && dfs(searching(current).head.to)) {
            searching(current).head.flow -= 1
            searching(current).head.pair.flow += 1
            result = true
          }
          searching(current) = searching(current).tail
        }
        result
      }
    }
    var flow = 0
    var hasFlow = true
    while (hasFlow) {
      hasFlow = false
      bfs()
      while(dfs(0)) {
        hasFlow = true
        flow += 1
      }
    }
    flow
  }
  case class Edge(to: Int, var flow: Int) {
    private var mPair = None: Option[Edge]
    def pair = mPair.get
    def pair_=(edge: Edge) = mPair = Some(edge)
  }
}



Measured memory_bytes: 59016