#include <bits/stdc++.h>
using namespace std;
int a[10000];
int main() {
  int n, a1, b;
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> a1 >> b;
    a[a1]++;
    a[b]++;
  }
  int c = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 1) c++;
  }
  cout << c << endl;
  return 0;
}
