from collections import deque def bfs(s): dq=deque() dq.append([s,0]) high=[10**9 for _ in range(N)] high[s]=0 while len(dq)!=0: p,h=dq.popleft() for e in edge[p]: if high[e]==10**9: dq.append([e,h+1]) high[e]=h+1 return high N=int(input()) edge=[[] for _ in range(N)] for _ in range(N-1): u,v=map(int,input().split()) edge[u-1].append(v-1) edge[v-1].append(u-1) dist=bfs(0) ans=0 for i in range(N): if dist[i]%2==1: ans+=1 print(min(ans,N-ans))