#include <bits/stdc++.h>
using namespace std;
int planet[1005];
int N, a, b, res = 0;
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) {
    planet[i] = 0;
  }
  for (int i = 1; i < N; i++) {
    cin >> a;
    planet[a]++;
    cin >> b;
    planet[b]++;
  }
  for (int i = 1; i <= N; i++) {
    if (planet[i] <= 1) res++;
  }
  cout << res;
}
