#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 322;
const long long LINF = 2e18 + 474;
const int MAXN = 1e3 + 228;
const int MOD = 1e9 + 7;
const double eps = 1e-14;
int a[MAXN], ans = 0;
void solve() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    a[x]++;
    a[y]++;
  }
  for (int i = 1; i <= 1000; i++) {
    ans += (int)(a[i] == 1 ? 1 : 0);
  }
  cout << ans;
}
int main() {
  if (!1) {
    freopen(
        "474"
        ".in",
        "r", stdin);
    freopen(
        "474"
        ".out",
        "w", stdout);
  }
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) solve();
  return 0;
}
