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