#include <bits/stdc++.h>
using namespace std;
int n, a[100005];
template <typename Drake>
void read(Drake &x) {
  x = 0;
  char ch = getchar();
  bool f = 1;
  while (!isdigit(ch)) {
    if (ch == '-') f ^= 1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  x *= (2 * f - 1);
}
void init() {
  read(n);
  int u, v;
  memset(a, 0, sizeof a);
  for (int i = 1; i < n; i++) read(u), read(v), a[u]++, a[v]++;
}
int main() {
  init();
  int cnt = 0;
  for (int i = 1; i <= n; i++) cnt += (a[i] == 1);
  cout << cnt << endl;
  return 0;
}
