Maximum flow 0#1711

Maximum flow 0

1 secondo
64 megabyte
Molto facile

UFOs have arrived and left us with this task.

Input

The first line of the input file contains two integers: and (2 \le n \le 10, 1 \le m \le n \cdot (n - 1)). These represent the number of vertices and edges in a graph where you need to determine the flow. Following this, each line describes an edge in the graph with three integers: , , (1 \le a, b \le n, a \ne b, 1 \le c \le 100). These numbers specify an edge from vertex to vertex with a capacity of . It is assured that the graph does not contain multiple edges between any two vertices.

Output

On a single line of the output file, print one number: the maximum flow from vertex to vertex .

Esempi

Esempio 1

Loading
Loading