CF387D George and Interesting Graph

Description

George loves graphs. Most of all, he loves interesting graphs. We will assume that a directed graph is interesting, if it meets the following criteria: - The graph doesn't contain any multiple arcs; - There is vertex $ v $ (we'll call her the center), such that for any vertex of graph $ u $ , the graph contains arcs $ (u,v) $ and $ (v,u) $ . Please note that the graph also contains loop $ (v,v) $ . - The outdegree of all vertexes except for the center equals two and the indegree of all vertexes except for the center equals two. The outdegree of vertex $ u $ is the number of arcs that go out of $ u $ , the indegree of vertex $ u $ is the number of arcs that go in $ u $ . Please note that the graph can contain loops. However, not everything's that simple. George got a directed graph of $ n $ vertices and $ m $ arcs as a present. The graph didn't have any multiple arcs. As George loves interesting graphs, he wants to slightly alter the presented graph and transform it into an interesting one. In one alteration he can either remove an arbitrary existing arc from the graph or add an arbitrary arc to the graph. George wonders: what is the minimum number of changes that he needs to obtain an interesting graph from the graph he's got as a present? Help George and find the answer to the question.

Input Format

N/A

Output Format

N/A

Explanation/Hint

For more information about directed graphs, please visit: http://en.wikipedia.org/wiki/Directed\_graph In the first sample the graph already is interesting, its center is vertex $ 3 $ .