#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, i, a[20000], j, count = 0;
  cin >> x;
  for (i = 0; i < 2 * x - 2; i++) {
    cin >> a[i];
  }
  for (j = 1; j <= x; j++) {
    int m = 0;
    for (i = 0; i < 2 * x - 2; i++) {
      if (a[i] == j) m++;
    }
    if (m == 1) count++;
  }
  cout << count;
}
