#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, a, b, ans = 0;
  cin >> n;
  vector<long long int> v[n + 1];
  for (int i = 1; i < n; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = 1; i < n + 1; i++) {
    if (v[i].size() == 1) ans++;
  }
  cout << ans;
}
