#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, a, b;
  scanf("%d", &N);
  int nums[N + 1];
  memset(nums, 0, sizeof nums);
  for (int i = 0; i < N - 1; ++i) {
    scanf("%d %d", &a, &b);
    ++nums[a];
    ++nums[b];
  }
  int quant = 0;
  for (int i = 1; i <= N; ++i) {
    if (nums[i] == 1) ++quant;
  }
  printf("%d\n", quant);
  return 0;
}
