#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n, ans = 0;
  cin >> n;
  vector<long long> adj[n + 1];
  for (long long i = 1; i < n; i++) {
    long long u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (long long i = 1; i < n + 1; i++) {
    if (adj[i].size() == 1) {
      ++ans;
    }
  }
  cout << ans;
  return 0;
}
