object Main extends App {
  // 標準入力からIntのArrayを作成して返却する。
  private def readAsIntArray = io.StdIn.readLine().split(' ').map(_.toInt)

  // 都市数、列車数、質問数を取得
  val Array(numCity, numTrain, numQuestion) = readAsIntArray

  // 列車のVectorを標準入力から作成
  val trains = for(_ <- 1 to numTrain) yield {
    val Array(first, last) = readAsIntArray
    Train(first, last)
  }

  // 質問のVectorを標準入力から作成
  val questions = for(_ <- 1 to numQuestion) yield {
    val Array(first, last) = readAsIntArray
    Question(first, last)
  }

  // 天才高橋に質問の答えを考えさせる
  val takahashi = new Takahashi
  takahashi.answer(trains, questions).foreach(println(_))
}

class Takahashi {
  def answer(trains: Seq[Train], questions: Seq[Question]): Seq[Int] = {
    for(q <- questions) yield {
      trains.filter(t => t.firstCity >= q.firstCity && t.lastCity <= q.lastCity).length
    }
  }
}

case class Question(firstCity: Int, lastCity: Int)
case class Train(firstCity: Int, lastCity: Int)
