static void Main() { var h = Read(); var n = h[0]; var es = Array.ConvertAll(new bool[h[1]], _ => Read()); var mf = new MaxFlow(n); mf.AddEdges(es); Console.WriteLine(mf.Dinic(0, n - 1)); }