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