Find the weight of the minimum spanning tree for an undirected weighted connected graph.
The first line contains the number of vertices and the number of edges (1 \leq n \leq 100, 1 \leq m \leq 6000). Each of the following lines contains three integers , , , 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