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