#include <bits/stdc++.h>
using namespace std;
set<pair<int, int> > dis;
set<pair<int, int> >::iterator its;
vector<int> g[200005];
int par[200005];
int depth[200005];
void dfs(int u, int p, int d) {
  depth[u] = d;
  if (d > 2) dis.insert(pair<int, int>(-d, u));
  par[u] = p;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (v == p) continue;
    dfs(v, u, d + 1);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(1, 0, 0);
  int ans = 0;
  while (dis.size() > 0) {
    its = dis.begin();
    int u = its->second;
    u = par[u];
    its = dis.find(pair<int, int>(-depth[u], u));
    ans++;
    if (its != dis.end()) dis.erase(its);
    for (int i = 0; i < g[u].size(); i++) {
      int v = g[u][i];
      its = dis.find(pair<int, int>(-depth[v], v));
      if (its != dis.end()) dis.erase(its);
    }
  }
  printf("%d\n", ans);
}
