#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, u, v, p[1001]{0}, res{0};
  cin >> n;
  for (int i = 0; i < n - 1; cin >> u >> v, p[u]++, p[v]++, i++)
    ;
  for (int i = 1; i <= n; i++)
    if (p[i] == 1) res++;
  cout << res;
}
