#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, int> mp;
  int a, b[100001], c[100001], d = 0, e = 0;
  cin >> a;
  for (int i = 0; i < a - 1; i++) {
    cin >> b[i] >> c[i];
    mp[b[i]]++;
    mp[c[i]]++;
  }
  for (int i = 0; i < a - 1; i++) {
    if (mp[c[i]] == 1 || mp[b[i]] == 1) {
      d++;
    }
  }
  cout << d;
  return 0;
}
