#include <bits/stdc++.h>
using namespace std;
int n, h[1005], cnt, ans;
struct Edge {
  int to, Next;
} e[2 * 1005];
void adde(int x, int y) { e[++cnt].to = y, e[cnt].Next = h[x], h[x] = cnt; }
void dfs(int u, int fa) {
  int son = 0;
  for (int i = h[u]; i; i = e[i].Next) {
    int v = e[i].to;
    if (v == fa) continue;
    son++;
    dfs(v, u);
  }
  if (son == 0) ans++;
  if (fa == 0 && son == 1) ans++;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    adde(x, y), adde(y, x);
  }
  dfs(1, 0);
  cout << ans << endl;
  return 0;
}
