#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int e[1000][1000], n;
bool visited[1000];
void dfs(int index){
visited[index] = true;
for (int i = 1; i <= n; i++) {
if(!visited[i] && e[index][i] == 1)
dfs(i);
}
}
int main(){
int m, k;
fill(e[0], e[999] + 1000, 0);
scanf("%d%d%d", &n, &m, &k);
for (int i = 0; i < m; i++) {
int a, b;
scanf("%d%d", &a, &b);
e[a][b] = e[b][a] = 1;
}
for (int i = 0; i < k; i++) {
int t;
fill(visited, visited + 1000, false);
scanf("%d", &t);
int cnt = 0;
visited[t] = true;
for (int j = 1; j <= n; j++) {
if(!visited[j]){
dfs(j);
cnt++;
}
}
printf("%d\n", cnt - 1);
}
return 0;
}