#include #include #include #include #include #include using namespace std; using i32 = int; using u32 = unsigned int; using i64 = long long; using u64 = unsigned long long; #define rep(i,n) for(int i=0; i<(int)(n); i++) const i64 INF = 1001001001001001001; using Modint = atcoder::static_modint<998244353>; int main(){ int N, K, M, P; cin >> N >> K >> M >> P; vector> adj(N); rep(i,M){ int u,v; cin >> u >> v; u--; v--; adj[u].push_back(v); adj[v].push_back(u); } vector S(N); rep(i,N) cin >> S[i]; using F = pair>; priority_queue, greater> que; vector hit(N); vector spr(N); vector rem(N); vector rec(N); rep(i,K){ int x; cin >> x; x--; hit[x] = 1; que.push({ S[x], {1,x} }); que.push({ P, {0,x} }); } while(que.size()){ auto [t,oc] = que.top(); que.pop(); auto [w,x] = oc; if(rem[x]) continue; if(w == 0){ rec[x] = 1; } else{ for(int y : adj[x]) if(rem[y] == 0 && rec[y] == 0){ if(hit[y]){ rem[y] = 1; continue; } hit[y] = 1; que.push({ t + S[y], {1,y} }); que.push({ t + P, {0,y} }); } } } int ans = 0; rep(i,N) ans += rem[i]; cout << ans << endl; return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_instance;