Find the weight of minimum spanning tree for a weighted undirected connected graph.
The first line contains the numbers n and m (1≤n≤100,1≤m≤6000), where n is the number of vertices in the graph and m is the number of edges. Each of the next m lines contains a triple of integers a,b,c, where a and b are the numbers of vertices connected by an edge and c is the weight of edge (a positive number not exceeding 30000).
Print the weight of minimum spanning tree.