#include <bits/stdc++.h>
using namespace std;
int n, arr[1010], x, y, c;
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    scanf("%d%d", &x, &y);
    arr[x]++;
    arr[y]++;
  }
  for (int i = 0; i <= 1000; ++i) {
    if (arr[i] == 1) c++;
  }
  cout << c;
}
