#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v;
  int x;
  for (int i = 0; i < 2 * n - 2; i++) {
    cin >> x;
    v.push_back(x);
  }
  int count = 0;
  sort(v.begin(), v.end());
  if (v[0] != v[1]) count++;
  for (int i = 1; i < 2 * n - 2; i++) {
    if (v[i] != v[i - 1] && v[i] != v[i + 1]) count++;
  }
  cout << count;
}
