logo AlgoBeat OnlineJudge
登录 注册

#217532. [ICPC 2018 Nanjing R] Cherry and Chocolate

内存限制:512 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Cherry and Chocolate play a game on a tree. First, Cherry picks a node and paints it pink. Then, Chocolate picks another node and paints it brown. Afterwards, Cherry picks yet another node and paints it pink. The game ends here. Chocolate doesn't get the second move.

For each node , if there is no path from to the brown node without passing through a pink node, Cherry gets a point.

Cherry wants to maximize her score, and Chocolate wants to minimize it. If both players play optimally, what will Cherry's score be?

输入格式

The first line contains an integer, (), the number of nodes on the tree.

Each of the next lines contains two integers and ,(), meaning there is an edge between node and node .

输出格式

A single integer, Cherry's score if both players play optimally.

样例

样例输入 1

4
1 2
2 3
2 4

样例输出 1

3