n=gets.to_i degrees=Array.new(n,0) (n-1).times{ a,b=gets.split.map(&:to_i) degrees[a-1]+=1 degrees[b-1]+=1 } puts degrees.count(1)-2