#include <bits/stdc++.h>
using namespace std;
vector<int> g[200005];
int dep[200005], par[200005];
void dfs(int node = 1, int cp = 1) {
  dep[node] = dep[cp] + 1;
  par[node] = cp;
  for (int x : g[node])
    if (x != cp) dfs(x, node);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, a, b;
  cin >> n;
  for (int i = 0; i < n - 1; i++)
    cin >> a >> b, g[a].push_back(b), g[b].push_back(a);
  dep[1] = -1;
  dfs();
  set<pair<int, int> > second;
  for (int i = 0; i < n; i++)
    if (dep[i + 1] > 2) second.insert({-dep[i + 1], i + 1});
  int ans = 0;
  while (second.size()) {
    pair<int, int> p = *second.begin();
    int v = par[p.second];
    second.erase({-dep[v], v});
    ans++;
    for (int x : g[v]) second.erase({-dep[x], x});
  }
  cout << ans;
}
