#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > g;
map<int, int> pr;
map<int, int> dis;
void dfs(int i, int cnt = 0, int par = -1) {
  pr[i] = par;
  dis[i] = cnt;
  for (auto x : g[i]) {
    if (x != par) dfs(x, cnt + 1, i);
  }
}
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  g = vector<vector<int> >(n + 1);
  int u, v;
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1);
  set<pair<int, int> > st;
  for (int i = 1; i <= n; i++) {
    if (dis[i] > 2) {
      st.insert({-dis[i], i});
    }
  }
  int cnt = 0;
  while (!st.empty()) {
    int i = st.begin()->second;
    i = pr[i];
    cnt++;
    auto it = st.find({-dis[i], i});
    if (it != st.end()) {
      st.erase(it);
    }
    for (auto x : g[i]) {
      auto it1 = st.find({-dis[x], x});
      if (it1 != st.end()) {
        st.erase(it1);
      }
    }
  }
  cout << cnt;
  return 0;
}
