This page is still under construction.

Parts of this page are still being built. What you see may change.

Surely You Congest

Time limit10sMemory limit256 MB

Summary
Route the most commuters to intersection 1 along shortest paths so no two enter the same road in the same direction at the same time.
Level

Hard8 of 10

Topics
Graph, Shortest path
Solved
No attempts yet

Problem

You are designing a centralized traffic management system for smart cars. Using global information, you must tell morning commuters who drive from the suburbs to downtown how to reach the city center while avoiding traffic jams.

Commuters know the city and act in their own interest, so you cannot ask anyone to take a route that is slower than their fastest one: they would simply ignore such advice. You may only move a commuter onto a different route that is exactly as fast as their shortest one.

The road network consists of intersections connected by bidirectional roads, each with a travel time. Every commuter starts at some intersection (which may differ between commuters), and all of them finish downtown, at intersection 11. Congestion happens when two commuters begin travelling along the same road in the same direction at the same moment, and this must never happen. It is fine for two commuters to pass through the same intersection at the same time, or to use the same road at different times.

Every commuter leaves at exactly the same time, and none of them may take a suboptimal route. Determine the maximum number of commuters who can reach downtown with no congestion.

Input

The input consists of a single test case. The first line contains three integers nn, mm, and cc, where nn (1≤n≤25 0001 \le n \le 25\,000) is the number of intersections, mm (0≤m≤50 0000 \le m \le 50\,000) is the number of roads, and cc (0≤c≤1 0000 \le c \le 1\,000) is the number of commuters.

Each of the next mm lines contains three integers xix_i, yiy_i, and tit_i describing one road, where xix_i and yiy_i (1≤xi,yi≤n1 \le x_i, y_i \le n) are the two distinct intersections it connects, and tit_i (1≤ti≤10 0001 \le t_i \le 10\,000) is the time to travel along it in either direction. Downtown (intersection 11) is reachable from every intersection.

The last line contains cc integers, the starting intersections of the commuters.

Output

Print the maximum number of commuters who can reach downtown without congestion.

Examples1

  1. Example 1

    Input
    4 4 5
    1 2 5
    1 3 4
    4 2 5
    4 3 6
    4 4 4 4 1
    
    Expected output
    3