Delivering Goods

Given a directed weighted graph and a set of client junctions, find the minimum number of trucks so each client is reached at its shortest-path time.

Medium7GraphShortest pathDynamic programmingMinimum spanning treeNo attempts yetTime limit5sMemory limit512 MB

Problem

You run a delivery company and have to send out trucks to bring goods to your clients. At the start of the day every package and every truck sits at your warehouse.

The road network consists of one-way streets between junctions. The warehouse and the clients are all at junctions, and you know the driving time of each street.

Your company guarantees extremely fast shipping. The trucks start driving the moment the day begins, and client ii receives the package at time TiT_i, where TiT_i is the shortest possible driving time from the warehouse to the junction of client ii.

What is the minimum number of trucks you have to deploy to keep that guarantee? That is, find the smallest number of trucks for which you can assign each truck a driving route so that every client ii is visited by some truck at time TiT_i. Loading a truck at the warehouse takes no time, and dropping goods off at a client takes no time once the truck arrives. The goods are small enough that a single truck can carry packages for as many clients as necessary.

Input

The input consists of a single test case.

The first line contains three integers NN, MM, and CC. Here NN is the number of junctions in the road network (2N1032 \le N \le 10^3), MM is the number of streets (1M1051 \le M \le 10^5), and CC is the number of clients (1C3001 \le C \le 300, C<NC < N).

The junctions are numbered 00 to N1N-1, and the warehouse is always at junction 00. The second line contains CC distinct integers, the junctions where the clients reside. Each of them is between 11 and N1N-1.

Each of the next MM lines contains integers UU, VV, WW (0U,VN10 \le U, V \le N-1, UVU \ne V, 1W1091 \le W \le 10^9). This means there is a one-way street from UU to VV with driving time WW.

There is at most one street from a junction UU to another junction VV, but a street from UU to VV and a street from VV to UU may both exist. Every client is reachable from the warehouse.

Output

Print a single integer, the minimum number of trucks required so that every client ii is visited at time TiT_i by some truck.

Hint

In the first example one truck can follow the path (0,1,2)(0, 1, 2) and the other can follow (0,3)(0, 3). In the second example the only solution uses the three paths (0,1)(0, 1), (0,2)(0, 2), and (0,3)(0, 3). In the last example one truck follows (0,1)(0, 1), another follows (0,4,6)(0, 4, 6), and the last one follows (0,2,3,5,7)(0, 2, 3, 5, 7).