#include <bits/stdc++.h>
int m[2001] = {0};
int main() {
  int n;
  scanf("%d", &n);
  int i;
  for (i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    m[a]++;
    m[b]++;
  }
  int count = 0;
  for (i = 1; i <= n; i++) {
    if (m[i] == 1) count++;
  }
  printf("%d", count);
}
