#include <bits/stdc++.h>
using namespace std;
void solve() {
  multiset<int> v;
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    v.insert(a);
    v.insert(b);
  }
  int count = 0;
  for (int i = 1; i <= n; i++) {
    if (v.count(i) == 1) count++;
  }
  cout << count;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
}
