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