Tree Game

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Consider the following game about coloring edges in a tree.

You are given a tree. Initially, the color of all edges is white. Let a valid path be a simple path such that all its edges are white, and the two endpoints are leaves in the tree. On each step of this game, you can choose a valid path and paint all its edges black. You cannot stop your game until you cannot find any valid path.

The purpose of this game is to use the minimum number of steps to complete the game. Please find the minimum number of steps for the given tree.

입력

The first line of input contains one integer NN indicating the number of nodes in the given tree.

Each of the following N1N-1 lines contains two integers xx and yy indicating that xx-th node and yy-th node are connected by an edge in the given tree. Nodes are numbered from 11 to NN.

출력

Output one integer: the minimum number of steps required to complete the game on the given tree.

제한

  • 2N1052 \le N \le 10^5
  • 1x,yN1 \le x, y \le N
  • The given graph is a tree.