#include <bits/stdc++.h>
using namespace std;
const long double E = 2.71828182845904523536;
const long double pi = acos(-1);
const double eps = 1e-9;
const long long mod = 1e9 + 7;
const long long inf = 1LL << 30;
const int N = 100100;
int deg[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    deg[v]++;
    deg[u]++;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (deg[i] == 1) ans++;
  }
  printf("%d", ans);
  return 0;
}
