Pandemic 2

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Vasya's friends are always playing the same board game called "Pandemic". Vasya is tired of this game, so he has decided to create his own version.

He chooses nn cities on the map of Byteland and n1n-1 bidirectional roads that connect them. Cities are enumerated by integers from 11 to nn, and roads are enumerated by integers from 11 to n1n-1. The ii-th road has length of l_il\_{i} kilometers and connects cities u_iu\_{i} and v_iv\_{i}. There is a path by the roads between any pair of the cities. During the game roads and cities become infected. A city can be either entirely infected, or not infected at all, and a road can contain both infected and not infected parts.

At the beginning of the game, the cities a_1,a_2,,a_ma\_1, a\_2, \ldots, a\_m become infected. Then the infection spreads along the adjacent roads. A city becomes infected at the moment when the infection reaches it. At the same time the infection begins to spread along roads adjacent to the city that has just been infected. The city becomes infected instantly, and the infection spreads along any road at the constant speed of one kilometer per minute.

At each moment of the game the yet uninfected cities and parts of roads form uninfected connected components. An uninfected city and adjacent uninfected parts of roads are always in the same component. Two uninfected cities are in the same component if and only if there is a path of uninfected roads that connects them. Uninfected connected component can contain no cities at all, in this case it consists of a single uninfected part of the road that connects already infected cities.

The game ends when all cities and roads become infected. Vasya has not yet come up with the roles for players, but first he wants to know what is the maximum number of uninfected connected components that would exist on the board at some moment of the game.

입력

The first line of input consists of one integer nn --- a number of chosen cities (2n1052 \le n \le 10^5). The following n1n-1 lines contain descriptions of chosen roads, the ii-th line contains three integers u_iu\_i, v_iv\_i and l_il\_i --- the cities connected by the ii-th road and its length (1u_i,v_in1 \le u\_i, v\_i \le n; u_iv_iu\_i \ne v\_i; 1l_i1091 \le l\_i \le 10^9).

The next line contains one integer mm --- the number of cities, that are infected at the beginning of the game (1mn1 \le m \le n). The next line contains a_1,a_2,,a_ma\_1, a\_2, \ldots, a\_m --- the numbers of these cities (1a_in1 \le a\_i \le n, all a_ia\_i are distinct).

출력

Print one integer --- the maximum number of uninfected connected components on the board at some moment of the game.