#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e6 + 10;
int n, k, nxt[maxn], to[maxn], hd[maxn], tot = 0, f[maxn], d[maxn];
std::set<pair<int, int>> S;
inline void add(int u, int v) {
  nxt[++tot] = hd[u];
  to[tot] = v;
  hd[u] = tot;
  return;
}
inline void dfs(int u, int fa, int dst) {
  d[u] = dst;
  f[u] = fa;
  for (register int i = hd[u]; i; i = nxt[i]) {
    int nx = to[i];
    if (nx == f[u]) continue;
    dfs(nx, u, dst + 1);
  }
  return;
}
int main() {
  scanf("%d", &n);
  int u, v;
  for (register int i = 1; i < n; ++i) {
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
  }
  dfs(1, 0, 0);
  for (register int i = 1; i <= n; ++i)
    if (d[i] > 2) S.insert(make_pair(-d[i], i));
  long long ans = 0;
  while (!S.empty()) {
    v = S.begin()->second;
    v = f[v];
    ans++;
    auto it = S.find(make_pair(-d[v], v));
    if (it != S.end()) S.erase(it);
    for (register int i = hd[v]; i; i = nxt[i]) {
      int nx = to[i];
      auto it = S.find(make_pair(-d[nx], nx));
      if (it != S.end()) S.erase(it);
    }
  }
  cout << ans;
  return 0;
}
