#include <bits/stdc++.h>
int n, cnt;
int deg[1005];
bool vis[1005];
int head[1005];
struct Edge {
  int to, nxt;
} edge[1005 << 1];
void add(int x, int y) {
  edge[++cnt].to = y;
  edge[cnt].nxt = head[x];
  head[x] = cnt;
}
void dfs(int now) {
  vis[now] = 1;
  for (int i = head[now]; i; i = edge[i].nxt) {
    int to = edge[i].to;
    if (vis[to]) continue;
    dfs(to);
    deg[now]++;
  }
}
signed main() {
  scanf("%d", &n);
  for (int x, y, i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
  }
  dfs(1);
  int ans = 0;
  for (int i = 2; i <= n; i++) {
    if (!deg[i]) ans++;
  }
  if (deg[1] == 1) ans++;
  printf("%d\n", ans);
  return 0;
}
