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