- 题目提供者 jjikkollp
- 评测方式 云端评测
- 标签 贪心 POI 2009 高性能
- 难度 省选/NOI-
- 时空限制 1000ms / 128MB
Byteasar has had a new palace built.
It consists of chambers and corridors connecting them. Each corridor connects exactly two chambers.
The rooms are numbered from to .
There is only a single entrance to the palace, which leads to chamber no. .
For each chamber there is exactly one route leading to it from the entrance, without turning back on the way.
In other words, the chambers and the corridors form a tree - a connected acyclic graph.
The fire marshal who is to approve the building demands placing fire extinguishers inside.
The following are his exact requirements:
The fire extinguishers should be placed in (some) chambers, and one chamber may store any number of extinguishers.
Each chamber has to be assigned one fire extinguisher, though it may be stored in another chamber.
Each fire extinguisher can be assigned to at most different chambers.
For each room its assigned extinguisher is within the range of corridors.
Byteasar has a week spot for lavish palaces, so it is no surprise he has very little money now, right after completion of another splendid palace.
Therefore he is interested in the minimum number of fire extinguishers sufficient for satisfying fire marshal's demands.
The first line of the standard input contains three integers , and separated by single spaces, , , .
Each of the following lines holds two integers separated by a single space.
Line no. contains the numbers denoting the corridor connecting chambers no. and .
The first and only line of the standard output is to hold one integer - the minimum number of fire extinguishers that have to be installed in palace.