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