#include <bits/stdc++.h>
using namespace std;
void stress();
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  stress();
}
vector<long long> g[200000];
long long d[200000];
map<long long, set<long long>> m;
void dfs(long long v, long long par) {
  if (par != -1) d[v] = d[par] + 1;
  m[d[v]].insert(v);
  for (auto to : g[v])
    if (to != par) {
      dfs(to, v);
    }
}
void stress() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    a--, b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(0, -1);
  long long ans = 0;
  while (m.size()) {
    long long v = *m.rbegin()->second.begin();
    if (d[v] <= 2) break;
    ans++;
    for (auto to : g[v]) {
      if (d[to] + 1 == d[v]) {
        for (auto u : g[to]) {
          if (m.count(d[u])) {
            m[d[u]].erase(u);
            if (!m[d[u]].size()) m.erase(d[u]);
          }
        }
        if (m.count(d[to])) {
          m[d[to]].erase(to);
          if (!m[d[to]].size()) m.erase(d[to]);
        }
        break;
      }
    }
  }
  cout << ans;
}
