import java.util

import scala.collection.mutable

object Main extends App {
  import scala.io.StdIn._
  val Array(n, m, q) = readLine.trim.split(' ').map(_.toInt)
  val stations = Array.tabulate(n){_ ⇒ new Station}
  val rails: Array[Rail] = Array.tabulate(m){it ⇒
    val Array(u, v) = readLine.trim.split(' ').map(_.toInt)
    val res = Rail(u - 1, v - 1)
    stations(u - 1).addRail(res)
    stations(v - 1).addRail(res)
    res
  }
  val plan = Array.tabulate(q){ _ ⇒ rails(readLine.trim.toInt - 1)}
  numOfIncrementClaim(stations, calMinCost(stations), plan, rails)
  def calMinCost(stations: Array[Station]): Array[Int] = {
    val res = Array.tabulate(stations.length){_ ⇒ Int.MaxValue}
    val queue: mutable.PriorityQueue[(Int, Int)] = mutable.PriorityQueue[(Int, Int)]()(Ordering.by[(Int, Int), Int]{case (_, d) ⇒ d}.reverse)
    queue.enqueue((0, 0))
    res(0) = 0
    while(queue.nonEmpty) {
      val (s, d) = queue.dequeue()
      if (res(s) == d){
        for (Rail(f, t) ← stations(s).neighbors) {
          if (res(f) > d + 1) {
            res(f) = d + 1
            queue.enqueue((f, d + 1))
          }
          if (res(t) > d + 1){
            res(t) = d + 1
            queue.enqueue((t, d + 1))
          }
        }
      }
    }
    res
  }
  case class Rail(from: Int, to: Int){
    var isValid: Boolean = true//最短ルートに使われていればtrue
  }
  class Station{
    private val haveRail: mutable.Queue[Rail] = new mutable.Queue()
    def addRail(to: Rail): Unit = haveRail.enqueue(to)
    def neighbors: Iterable[Rail] = haveRail
  }
  def numOfIncrementClaim(stations: Array[Station], minPrice: Array[Int], plan: Iterable[Rail], rails: Array[Rail]): Unit = {
    val minRailToCount = Array.tabulate(stations.length){ _ ⇒ 0}//minRailFromCount(i) x -> iの最短路線がある
    var wholeCount = 0
    var stack: List[Int] = Nil
    for (r@Rail(from, to) ← rails){
      if (minPrice(from) + 1 != minPrice(to) && minPrice(to) + 1 != minPrice(from)){
        r.isValid = false
      }else if (minPrice(from) + 1 == minPrice(to)){
        minRailToCount(to) += 1
      }else if (minPrice(to) + 1 == minPrice(from)){
        minRailToCount(from) += 1
      }
    }
    for (r@Rail(from, to) ← plan) {
      if (r.isValid) {
        r.isValid = false
        if (minPrice(from) == minPrice(to) + 1) {
          minRailToCount(from) -= 1
          if (minRailToCount(from) == 0) {
            wholeCount += 1
            stack ::= from
            while (stack.nonEmpty) {
              val head = stack.head
              stack = stack.tail
              for (rr@Rail(f, t) ← stations(head).neighbors.filter(_.isValid)) {
                rr.isValid = false
                if (f == head) {
                  minRailToCount(t) -= 1
                  if (minRailToCount(t) == 0) {
                    stack ::= t
                    wholeCount += 1
                  }
                } else {
                  minRailToCount(f) -= 1
                  if (minRailToCount(f) == 0) {
                    stack ::= f
                    wholeCount += 1
                  }
                }
              }
            }
          }
        }

        if (minPrice(to) == minPrice(from) + 1) {
          minRailToCount(to) -= 1
          if (minRailToCount(to) == 0) {
            wholeCount += 1
            stack ::= to
            while (stack.nonEmpty) {
              val head = stack.head
              stack = stack.tail
              for (rr@Rail(f, t) ← stations(head).neighbors.filter(_.isValid)) {
                rr.isValid = false
                if (f == head) {
                  minRailToCount(t) -= 1
                  if (minRailToCount(t) == 0) {
                    stack ::= t
                    wholeCount += 1
                  }
                } else {
                  minRailToCount(f) -= 1
                  if (minRailToCount(f) == 0) {
                    stack ::= f
                    wholeCount += 1
                  }
                }
              }
            }
          }
        }
      }
      println(wholeCount)
    }
  }
}

