In the magical land of Rudolandia, where foxes live, there are villages. Some pairs of these villages are connected by roads. To optimize resources, there are no redundant roads, meaning there is exactly one path between any two villages.
Recent studies have revealed that Rudolandia is located in a seismically active area. Consequently, the head fox is interested in understanding the potential impact of an earthquake on the foxes' land. Specifically, she wants to determine the minimum number of roads that need to be destroyed to form an isolated group of exactly villages. Within this group, it should still be possible to travel between any two villages using the remaining roads. A group is considered isolated if no remaining road connects a village in this group to a village outside of it.
Your task is to write a program to assist her in this analysis.
The first line contains two integers and (1 \leq p \leq n \leq 150). The subsequent lines describe the roads, with each line containing two integers representing the villages connected by that road (with numbers from to ). All input numbers are separated by spaces and/or line breaks.
Output a single integer — the minimum number of roads that must be destroyed.
Example 1
Example 2