#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int dep[N], fa[N], n, hd[N], tot, vis[N];
struct Edge {
  int v, nx;
} e[N << 1];
void add(int u, int v) {
  e[tot].v = v;
  e[tot].nx = hd[u];
  hd[u] = tot++;
}
void dfs(int u, int f) {
  for (int i = hd[u]; ~i; i = e[i].nx) {
    int v = e[i].v;
    if (v == f) continue;
    fa[v] = u;
    dep[v] = dep[u] + 1;
    dfs(v, u);
  }
}
int main() {
  memset(hd, -1, sizeof(hd));
  scanf("%d", &n);
  int u, v, ans = 0;
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
    dep[i] = 0;
  }
  dfs(1, 0);
  priority_queue<pair<int, int> > q;
  for (int i = 1; i <= n; i++)
    if (dep[i] > 2) q.push(make_pair(dep[i], i));
  while (q.size()) {
    u = q.top().second;
    q.pop();
    if (vis[u]) continue;
    ans++;
    vis[fa[u]] = 1;
    for (int i = hd[fa[u]]; ~i; i = e[i].nx) vis[e[i].v] = 1;
  }
  printf("%d\n", ans);
  return 0;
}
