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