
n = int(input())
counts = [0] * (n + 1)
for i in range(0, n - 1):
    x, y = [int(j) for j in input().split(" ")]
    counts[x], counts[y] = counts[x] + 1, counts[y] + 1

result = 0
for c in counts:
    if c == 1:
        result += 1

print(result - 2)
