#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
vector<int> g[N], a, p;
vector<bool> used;
set<pair<int, int>> s;
void dfs(int v, int d, int anc) {
  used[v] = true;
  p[v] = anc;
  a[v] = d;
  if (d > 2) s.insert({d, v});
  for (int i : g[v]) {
    if (!used[i]) dfs(i, d + 1, v);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  used.resize(n, false);
  a.resize(n, 0);
  p.resize(n, -1);
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(0, 0, 0);
  int ans = 0;
  while (!s.empty()) {
    int v = s.rbegin()->second;
    int w = s.rbegin()->first;
    ans++;
    v = p[v];
    w = a[v];
    a[v] = 1;
    if (s.find({w, v}) != s.end()) s.erase({w, v});
    for (int i : g[v]) {
      if (a[i] > 2) {
        s.erase({a[i], i});
        a[i] = 2;
      }
    }
  }
  cout << ans;
  return 0;
}
