#include <bits/stdc++.h>
using namespace std;
int n, u, v, f[1001];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  int ans = 0;
  for (int i = 1; i <= n - 1; ++i) {
    cin >> u >> v;
    f[u]++;
    f[v]++;
  }
  for (int i = 1; i <= n; ++i)
    if (f[i] == 1) ans++;
  cout << ans;
  return 0;
}
