#include <bits/stdc++.h>
using namespace std;
const long long N = 200005;
long long lvl[N];
vector<long long> g[N];
long long par[N];
void dfs(long long x, long long p, long long d) {
  lvl[x] = d;
  par[x] = p;
  for (long long y : g[x]) {
    if (y == p) continue;
    dfs(y, x, d + 1);
  }
}
signed main() {
  long long n, u, v;
  cin >> n;
  for (__typeof((n - 1)) i = (1); i <= (n - 1); i++) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, 1, 0);
  set<pair<long long, long long> > s;
  for (__typeof((n)) i = (1); i <= (n); i++) {
    if (lvl[i] >= 3) s.insert({-lvl[i], i});
  }
  long long ans = 0;
  while (!s.empty()) {
    auto it = s.begin();
    ans++;
    long long x = it->second;
    s.erase(it);
    x = par[x];
    s.erase({-lvl[x], x});
    for (long long y : g[x]) {
      if (s.find({-lvl[y], y}) != s.end()) s.erase({-lvl[y], y});
    }
  }
  cout << ans << '\n';
  return 0;
}
