Find the weight of the minimum spanning tree for an undirected weighted connected graph.
The first line contains the number of vertices and m~(1 \le n \le 100, 1 \le m \le 6000) edges in the graph. Each of the following lines contains a triplet of numbers a, b, c, where and are the vertex numbers connected by an edge, and is the weight of the edge (a positive integer not exceeding ).
Print the weight of the minimum spanning tree.

Example 1