#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1000000000")
using namespace std;
using pii = pair<int, int>;
using ll = long long;
using pll = pair<long long, long long>;
using pil = pair<int, long long>;
using vi = vector<int>;
using vll = vector<long long>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vpii = vector<pair<int, int>>;
using vd = vector<double>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pdd = pair<double, double>;
using pss = pair<string, string>;
const ll mod = 1e9 + 7;
const ll INF = 1e18;
const int maxn = 2e5;
int n;
vi g[maxn];
int dist[maxn], par[maxn];
vi vert;
void bfs(int v) {
  queue<int> q;
  q.push(v);
  while (!q.empty()) {
    int cur = q.front();
    q.pop();
    for (auto& to : g[cur]) {
      if (dist[to] or to == v) continue;
      dist[to] = dist[cur] + 1;
      if (dist[to] > 2) vert.push_back(to);
      q.push(to);
      par[to] = cur;
    }
  }
}
int ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  bfs(0);
  for (int i = ((int)(vert).size()) - 1; i >= 0; i--) {
    if (dist[vert[i]] > 2) {
      ans++;
      dist[par[vert[i]]] = 1;
      for (auto& to : g[par[vert[i]]]) dist[to] = 2;
    }
  }
  cout << ans;
  return 0;
}
