#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, d[N], p[N];
set<pair<int, int> > q;
vector<int> g[N];
void dfs(int v, int pr = -1) {
  p[v] = pr;
  if (d[v] > 2) {
    q.insert(make_pair(d[v], v));
  }
  for (int to : g[v]) {
    if (to != pr) {
      d[to] = d[v] + 1;
      dfs(to, v);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1);
  int ans = 0;
  while (!q.empty()) {
    ans++;
    int v = p[q.rbegin()->second];
    q.erase(make_pair(d[v], v));
    for (int to : g[v]) {
      q.erase(make_pair(d[to], to));
    }
  }
  cout << ans;
}
