#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <map>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

struct Info{
	int from,to;
	bool erased;
};

struct Line{
	Line(int arg_to,int arg_info_index){
		to = arg_to;
		info_index = arg_info_index;
	}
	int to,info_index;
};

struct Data{
	Data(int arg_town,int arg_total_cost){
		town = arg_town;
		total_cost = arg_total_cost;
	}
	bool operator<(const struct Data &arg) const{
		return total_cost > arg.total_cost;
	};
	int town,total_cost;
};

struct Shishimaru{
	Shishimaru(int arg_from_town){
		from_town = arg_from_town;
	}
	int from_town;
};

vector<Line> V[100001];

int main(){

	int N,M,Q;
	scanf("%d %d %d",&N,&M,&Q);


	int* min_dist = new int[N+1];
	int* In_degree = new int[N+1];
	int* num_discontent = new int[Q];

	for(int i = 1; i <= N; i++){
		min_dist[i] = BIG_NUM;
		In_degree[i] = 0;
	}

	for(int i = 0; i < Q; i++){
		num_discontent[i] = 0;
	}

	Info* info = (Info*)malloc(sizeof(Info)*(M+1));


	for(int i = 1; i <= M; i++){
		scanf("%d %d",&info[i].from,&info[i].to);
		V[info[i].from].push_back(Line(info[i].to,i));
		V[info[i].to].push_back(Line(info[i].from,i));
		info[i].erased = false;
	}


	min_dist[1] = 0;
	In_degree[1] = 1;

	priority_queue<Data> PQ;

	for(int i = 0; i < V[1].size(); i++){
		min_dist[V[1][i].to] = 1;
		In_degree[V[1][i].to]++;
		PQ.push(Data(V[1][i].to,1));
	}

	while(!PQ.empty()){

		if(PQ.top().total_cost > min_dist[PQ.top().town]){
			PQ.pop();
		}else{

			for(int i = 0; i < V[PQ.top().town].size(); i++){
				if(min_dist[V[PQ.top().town][i].to] > PQ.top().total_cost+1){
					min_dist[V[PQ.top().town][i].to] = PQ.top().total_cost+1;
					In_degree[V[PQ.top().town][i].to] = 1;
					PQ.push(Data(V[PQ.top().town][i].to,PQ.top().total_cost+1));
				}else if(min_dist[V[PQ.top().town][i].to] == PQ.top().total_cost+1){
					In_degree[V[PQ.top().town][i].to]++;
				}
			}
			PQ.pop();
		}
	}

	int R,base_town;
	queue<Shishimaru> S;

	for(int i = 0; i < Q; i++){
		scanf("%d",&R);
		info[R].erased = true;

		if(abs(min_dist[info[R].from]-min_dist[info[R].to]) != 1)continue;
		if(In_degree[info[R].from] == 0 || In_degree[info[R].to] == 0)continue;

		if(min_dist[info[R].to] == min_dist[info[R].from]+1){
			base_town = info[R].to;
		}else{
			base_town = info[R].from;
		}

		In_degree[base_town]--;

		if(In_degree[base_town] == 0){

			num_discontent[i]++;

			S.push(Shishimaru(base_town));

			while(!S.empty()){
				for(int k = 0; k < V[S.front().from_town].size(); k++){
					if(min_dist[V[S.front().from_town][k].to] == min_dist[S.front().from_town]+1 && info[V[S.front().from_town][k].info_index].erased == false){

						In_degree[V[S.front().from_town][k].to]--;
						if(In_degree[V[S.front().from_town][k].to] == 0){
							num_discontent[i]++;
							S.push(Shishimaru(V[S.front().from_town][k].to));
						}
					}
				}
				S.pop();
			}
		}
	}

	for(int i = 1; i < Q; i++){
		num_discontent[i] += num_discontent[i-1];
	}

	for(int i = 0; i < Q; i++){
		printf("%d\n",num_discontent[i]);
	}

	return 0;
}

Measured memory_bytes: 15868