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