#include <bits/stdc++.h>
using namespace std;
int n, ans;
map<int, int> m;
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    ++m[u];
    ++m[v];
  }
  for (auto el : m) {
    if (el.second == 1) ++ans;
  }
  cout << ans;
  getchar();
  getchar();
  return 0;
}
