#include <bits/stdc++.h>
using namespace std;
const int N = 200 * 1000 + 12;
int parent[N];
vector<int> graph[N];
int level[N];
void dfs(int src, int pr = -1, int l = 0) {
  parent[src] = pr;
  level[src] = l;
  for (auto it = graph[src].begin(); it != graph[src].end(); it++) {
    if (*it != pr) {
      parent[*it] = src;
      dfs(*it, src, l + 1);
    }
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  parent[1] = -1;
  level[0] = -1;
  dfs(1);
  set<pair<int, int> > s;
  for (int i = 1; i <= n; i++) {
    if (level[i] > 2) {
      s.insert(make_pair(-level[i], i));
    }
  }
  int result = 0;
  while (!s.empty()) {
    int val = s.begin()->second;
    val = parent[val];
    auto it = s.find(make_pair(-level[val], val));
    if (it != s.end()) {
      s.erase(it);
    }
    for (auto to : graph[val]) {
      auto it = s.find(make_pair(-level[to], to));
      if (it != s.end()) {
        s.erase(it);
      }
    }
    result++;
  }
  cout << result;
  return 0;
}
