#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  int l = (n - 1) * 2;
  int val;
  for (int i = 0; i < n - 1; i++) {
    mp.insert({i + 1, 0});
  }
  for (int i = 0; i < l; i++) {
    cin >> val;
    mp[val]++;
  }
  int count = 0;
  for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
    if (itr->second == 1) {
      count++;
    };
  }
  cout << count << endl;
  return 0;
}
