#include <bits/stdc++.h>
using namespace std;
vector<int> mat[200010];
int n, lev[200010], baap[200010];
int dfs(int p, int pa) {
  int ret = 0;
  for (auto x : mat[p]) {
    if (x == pa) continue;
    lev[x] = lev[p] + 1;
    baap[x] = p;
    ret += dfs(x, p);
  }
  if (lev[p] > 2) {
    ret++;
    lev[pa] = 1;
    lev[p] = 2;
    lev[baap[pa]] = min(lev[baap[pa]], 2);
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  int a, b;
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    cin >> a >> b;
    mat[a].push_back(b);
    mat[b].push_back(a);
  }
  cout << dfs(1, 1) << endl;
  return 0;
}
