#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, count = 0;
  cin >> n;
  int arr1[n - 1], arr2[n - 1];
  for (i = 0; i < n - 1; i++) cin >> arr1[i] >> arr2[i];
  map<int, int> u;
  for (i = 0; i < n - 1; i++) {
    u[arr1[i]]++;
    u[arr2[i]]++;
  }
  for (i = 0; i < n - 1; i++) {
    if (u[arr1[i]] == 1) count++;
  }
  for (i = 0; i < n - 1; i++) {
    if (u[arr2[i]] == 1) count++;
  }
  cout << count;
}
