#include <bits/stdc++.h>
using namespace std;
int n, ans;
int cnt, head[200005];
int fa[200005];
bool vis[200005], cho[200005];
struct NODE {
  int to, nxt;
} edge[200005 << 1];
void addedge(int u, int v) {
  edge[++cnt].to = v;
  edge[cnt].nxt = head[u];
  head[u] = cnt;
}
void dfs(int d, int fath) {
  fa[d] = fath;
  if (d == 1 || fath == 1 || fa[fath] == 1) vis[d] = 1;
  for (int i = head[d]; i; i = edge[i].nxt) {
    int v = edge[i].to;
    if (v == fath) continue;
    if (cho[d]) vis[v] = 1;
    dfs(v, d);
  }
  if (!vis[d]) {
    ans++;
    vis[d] = 1;
    cho[fath] = vis[fath] = 1;
    vis[fa[fath]] = 1;
  }
}
void init() {
  int a, b;
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i) {
    scanf("%d %d", &a, &b);
    addedge(a, b);
    addedge(b, a);
  }
}
void solve() {
  dfs(1, 0);
  printf("%d", ans);
}
int main() {
  init();
  solve();
  return 0;
}
