#include <bits/stdc++.h>
using namespace std;
vector<int> grafo[200010];
int P[200010];
int dist[200010];
bool visit[200010] = {0};
void dfs(int x) {
  visit[x] = true;
  for (int i = 0; i < grafo[x].size(); i++) {
    int v = grafo[x][i];
    if (!visit[v]) {
      P[v] = x;
      dist[v] = dist[x] + 1;
      dfs(v);
    }
  }
}
int main() {
  int n, u, v;
  cin >> n;
  dist[1] = 0;
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    grafo[u].push_back(v);
    grafo[v].push_back(u);
  }
  dfs(1);
  set<pair<int, int> > s;
  for (int i = 1; i <= n; i++)
    if (dist[i] > 2) s.insert(make_pair(-dist[i], i));
  int res = 0;
  while (!s.empty()) {
    auto it = s.begin();
    int y = s.begin()->second;
    int x = P[y];
    auto ite = s.find(make_pair(-dist[x], x));
    res++;
    if (ite != s.end()) s.erase(ite);
    for (int i = 0; i < grafo[x].size(); i++) {
      int h = grafo[x][i];
      if (h != P[h]) {
        auto iter = s.find(make_pair(-dist[h], h));
        if (iter != s.end()) s.erase(iter);
      }
    }
  }
  cout << res;
}
