Maximum Flow A#3640

Maximum Flow A

1 second
128 megabytes
Very easy

The undirected graph without loops and multiple edges with vertices is given (the vertices are numbered from to ). For each edge we know its capacity. Find the value of the maximum flow from the vertex to the vertex . The flow can flow along each edge in both directions.

Input

Two numbers and k~(2 \le n \le 100, 0 \le k \le n \cdot (n - 1) / 2) — the number of vertices and edges in a graph. Each of the next lines contains three numbers a, b, c~(1 \le a, b \le n, 1 \le c \le 10^9) — the vertices, connected with an edge, and the capacity of this edge.

Output

Print the maximum flow from the vertex to the vertex .

Examples

Example 1

Loading
Loading