CSES - KILO 2017 4/5 - Flowery Trails
  • Time limit: 1.00 s
  • Memory limit: 512 MB

In order to attract more visitors, the manager of a national park had the idea of planting flowers along both sides of the popular trails, which are the trails used by common people. Common people only go from the park entrance to its highest peak, where views are breathtaking, by a shortest path. So, he wants to know how many metres of flowers are needed to materialize his idea.

Given a description of the park, with its points of interest and (two-way) trails, the goal is to find out the extent of flowers needed to cover both sides of the popular trails. It is guaranteed that, for the given inputs, there is some path from the park entrance to the highest peak.

Input

The first line of the input has two integers: nn and mm. nn is the number of points of interest and mm is the number of trails. Points are identified by integers, ranging from 11 to nn. The entrance point is 1 and the highest peak is point nn.

Each of the following mm lines characterises a different trail. It contains three integers, uiu_i, viv_i and lil_i, which indicate that a (two-way) trail links directly points uiu_i and viv_i (not necessarily distinct) and has length lil_i (in metres).

Output

Output a single line with the extent of flowers (in metres) needed to cover both sides of the popular trails.

Constraints

  • 2n100002 \le n \le 10000
  • 1m2500001 \le m \le 250 000
  • 1ui,vin1 \le u_i, v_i \le n
  • 1li10001 \le l_i \le 1000

Examples

Input:

4 7
1 2 1
1 3 2
1 4 10
1 4 3
2 4 2
3 4 1
2 2 1

Output:

18

Input:

10 15
1 2 580
2 5 90
2 5 90
5 10 250
5 3 510
3 8 600
8 4 200
4 4 380
4 1 150
1 4 100
8 9 500
8 10 620
10 7 510
7 6 145
6 10 160

Output:

3860