#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll stringtoll(string s) {
  stringstream geek(s);
  ll x = 0;
  geek >> x;
  return x;
}
int stringtoint(string s) {
  stringstream geek(s);
  int x = 0;
  geek >> x;
  return x;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> x[n + 1];
  int a, b;
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    x[a].push_back(b);
    x[b].push_back(a);
  }
  int ans = 0;
  for (int i = 1; i < n + 1; i++) {
    if (x[i].size() == 1) ans++;
  }
  cout << ans << "\n";
}
