#include <bits/stdc++.h>
using namespace std;
vector<int> graph[200005];
bool visited[200005];
int parent[200005];
int depth[200005];
bool visited_2[200005];
void dfs(int n, int d) {
  visited[n] = 1;
  depth[n] = d;
  for (int i = 0; i < graph[n].size(); i++) {
    if (visited[graph[n][i]]) {
      continue;
    } else {
      parent[graph[n][i]] = n;
      dfs(graph[n][i], d + 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);
  }
  dfs(1, 0);
  parent[1] = 1;
  priority_queue<pair<int, int> > q;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    pair<int, int> r;
    r.first = depth[i];
    r.second = i;
    q.push(r);
  }
  while (q.size() && (q.top().first > 2)) {
    pair<int, int> r = q.top();
    q.pop();
    if (visited_2[r.second]) {
      continue;
    }
    visited_2[r.second] = 1;
    ans++;
    visited_2[parent[r.second]] = 1;
    for (int j = 0; j < graph[parent[r.second]].size(); j++) {
      visited_2[graph[parent[r.second]][j]] = 1;
    }
    visited_2[parent[parent[r.second]]] = 1;
  }
  cout << ans;
}
