Even Forest
시간 제한3초메모리 제한512 MB
트리에서 간선을 최소한으로 제거해 남은 각 성분에서 두 리프 사이의 홀수 길이 경로가 없도록 만든다.
문제
An undirected tree is called even if there is no simple path of odd length connecting two of its leaves. In particular, a tree with just one vertex is considered even.
You are given an undirected tree with vertices numbered from to . A graph obtained by removing some (possibly none) of the edges of is called a forest: it consists of one or more disjoint trees. Determine the minimum possible number such that we can remove edges of in such a way that the resulting forest consists only of even trees.
입력
The first line contains one integer ().
Each of the next lines contains two integers and () denoting an edge connecting vertex and vertex .
The graph is guaranteed to be a tree.
출력
Output the minimum number of edges such that we can remove edges of in such a way that each tree in the resulting forest is even.