#include <bits/stdc++.h>
int main() {
  int i, j, n, k, x, y, cnt = 0, a[2005];
  scanf("%d", &n);
  k = n - 1;
  for (i = 0; i < 2 * k; i++) scanf("%d", &a[i]);
  for (j = 1; j <= n; j++) {
    x = 0;
    for (i = 0; i < 2 * k; i++) {
      if (a[i] == j) x++;
    }
    if (x == 1) cnt++;
  }
  printf("%d", cnt);
}
