#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, ans = 0;
  cin >> n;
  std::map<long long, long long> mp;
  for (long long i = 1; i < n; i++) {
    long long u, v;
    cin >> u >> v;
    mp[u]++;
    mp[v]++;
  }
  for (auto x : mp) {
    if (x.second == 1) ans += 1;
  }
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
