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