#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 10;
int deg[maxn];
int n;
int main() {
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    int u, v;
    cin >> u >> v;
    deg[u]++, deg[v]++;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) ans += deg[i] == 1;
  cout << ans << endl;
}
