#include <bits/stdc++.h>
using namespace std;
vector<int> v[200010];
priority_queue<pair<int, int> > pq;
int par[200010];
bool vis[200010];
void dfs(int parent, int source, int height) {
  par[source] = parent;
  for (int i : v[source]) {
    if (i == parent) continue;
    dfs(source, i, height + 1);
  }
  if (height > 2) pq.push(make_pair(height, source));
}
int main() {
  int n;
  cin >> n;
  int x, y;
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  dfs(0, 1, 0);
  int ans = 0;
  while (!pq.empty()) {
    int s = pq.top().second;
    if (!vis[s]) {
      int papa = par[s];
      for (int it : v[papa]) {
        vis[it] = true;
      }
      vis[papa] = true;
      ans++;
    }
    pq.pop();
  }
  cout << ans << endl;
  return 0;
}
