#include <bits/stdc++.h>
int main() {
  int32_t num_planets;
  std::cin >> num_planets;
  std::vector<int32_t>* tree = new std::vector<int32_t>[num_planets];
  for (int32_t i = 0; i < num_planets - 1; i++) {
    int32_t src, dst;
    std::cin >> src >> dst;
    src--;
    dst--;
    tree[src].push_back(dst);
    tree[dst].push_back(dst);
  }
  int32_t answer = 0;
  for (int32_t i = 0; i < num_planets; i++)
    if (tree[i].size() == 1) answer++;
  std::cout << answer;
  return 0;
}
