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