#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200100;
vector<int> g[MAXN];
int ans;
int dfs(int v, int p, int h = 0) {
  int rez = 2;
  for (auto to : g[v]) {
    if (to != p) rez = min(rez, dfs(to, v, h + 1));
  }
  if (rez == 0 && p != 1 && h >= 2) {
    ans++;
    return 1;
  }
  if (rez == 1) return 2;
  if (rez == 2) return 0;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, v, u;
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  dfs(1, 1);
  cout << ans << '\n';
}
