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