#include <bits/stdc++.h>
using namespace std;
bool test = 0;
void solve() {
  int n;
  cin >> n;
  vector<int> vec[n + 1];
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    vec[u].push_back(v);
    vec[v].push_back(u);
  }
  int ans = 0;
  int curr;
  for (int j = 1; j <= n; j++) {
    if (vec[j].size() == 1) ans++;
  }
  cout << ans;
}
int main() {
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  if (test) {
    int t;
    cin >> t;
    while (t--) solve();
  } else
    solve();
  return 0;
}
