#include <bits/stdc++.h>
using namespace std;
void DFS(const vector<vector<int> > &graph, vector<int> &dist,
         vector<int> &parent) {
  stack<pair<int, int> > st;
  st.push({0, 0});
  while (!st.empty()) {
    int pos = st.top().first;
    int val = st.top().second;
    st.pop();
    dist[pos] = val;
    for (int i = 0; i < graph[pos].size(); ++i)
      if (parent[pos] != graph[pos][i]) {
        st.push({graph[pos][i], val + 1});
        parent[graph[pos][i]] = pos;
      }
  }
}
int main() {
  size_t n;
  cin >> n;
  vector<vector<int> > graph(n);
  for (size_t i = 0; i < n - 1; ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  vector<int> dist(n);
  vector<int> parent(n);
  DFS(graph, dist, parent);
  set<pair<int, int> > remote;
  for (size_t i = 1; i < dist.size(); ++i)
    if (dist[i] > 2) remote.insert({-dist[i], i});
  int ans = 0;
  while (!remote.empty()) {
    int pos = remote.begin()->second;
    pos = parent[pos];
    if (remote.find({-dist[pos], pos}) != remote.end())
      remote.erase(remote.find({-dist[pos], pos}));
    for (int i = 0; i < graph[pos].size(); ++i)
      if (remote.find({-dist[graph[pos][i]], graph[pos][i]}) != remote.end())
        remote.erase(remote.find({-dist[graph[pos][i]], graph[pos][i]}));
    ++ans;
  }
  cout << ans;
  return 0;
}
