#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int ans, vis[N];
vector<int> g[N];
void dfs(int u, int fa, int d) {
  int k = 0;
  for (auto v : g[u])
    if (v != fa) dfs(v, u, d + 1), k += !vis[v];
  if (k && d >= 2) ans++, vis[u] = vis[fa] = 1;
}
int main(void) {
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  n--;
  while (n--) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  cout << (dfs(1, 1, 0), ans) << endl;
  return 0;
}
