#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y, count = 0;
  cin >> n;
  vector<int> arr[n + 1];
  for (int i = 0; i < n - 1; i++) {
    cin >> x >> y;
    arr[x].push_back(y);
    arr[y].push_back(x);
  }
  for (int i = 0; i < n + 1; i++) {
    if (arr[i].size() == 1) {
      count++;
    }
  }
  cout << count;
}
