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