class Node: def __init__(self): self.edge=[] self.degree=0 def add_edge(self,new_edge): self.edge.append(new_edge) self.degree+=1 class Edge: def __init__(self,node_a,node_b): node_a.add_edge(self) node_b.add_edge(self) self.node=(node_a,node_b) class Graph: def __init__(self): self.node={} self.edge=[] def add_edge(self,new_edge): if not new_edge[0] in self.node: self.node[new_edge[0]]=Node() if not new_edge[1] in self.node: self.node[new_edge[1]]=Node() self.edge.append(Edge(self.node[new_edge[0]],self.node[new_edge[1]])) n=int(input()) g=Graph() for i in range(n-1): g.add_edge(list(map(int,input().split()))) c=-2 for i in g.node: if g.node[i].degree==1: c+=1 print(c)