#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int nm = 0, fh = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') fh = -1;
  for (; isdigit(c); c = getchar()) nm = nm * 10 + c - '0';
  return nm * fh;
}
int n, tot, to[200020 << 1], nt[200020 << 1], fs[200020];
int fa[200020], dep[200020], ans;
bool vis[200020];
priority_queue<pair<int, int> > que;
inline void link(int x, int y) { to[++tot] = y, nt[tot] = fs[x], fs[x] = tot; }
inline void dfs(int x, int last = 0) {
  fa[x] = last, dep[x] = dep[last] + 1;
  for (int i = fs[x]; i; i = nt[i])
    if (to[i] ^ last) dfs(to[i], x);
}
int main() {
  n = read();
  for (int i = 1, x, y; i < n; i++)
    x = read(), y = read(), link(x, y), link(y, x);
  dfs(1);
  for (int i = 1; i <= n; i++)
    if (dep[i] > 3) que.push(make_pair(dep[i], i));
  while (!que.empty()) {
    int x = que.top().second;
    que.pop();
    if (vis[x] || dep[x] <= 3) continue;
    x = fa[x], vis[x] = true, ans++;
    for (int i = fs[x]; i; i = nt[i]) vis[to[i]] = true;
  }
  printf("%d\n", ans);
  return 0;
}
