#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
using namespace std;
long long n;
vector<long long> adj[200010];
long long dp[200010][3][3];
long long sol(long long v, long long p, long long cur, long long par) {
  long long &ret = dp[v][cur][par];
  if (ret != -1) return ret;
  ret = 0;
  if (cur == 1) {
    for (auto x : adj[v]) {
      if (x == p) continue;
      ret += min(sol(x, v, 0, 1), sol(x, v, 1, 1) + 1);
    }
  } else {
    if (par == 1) {
      for (auto x : adj[v]) {
        if (x == p) continue;
        ret += min(sol(x, v, 1, 0) + 1, sol(x, v, 0, 0));
      }
    } else {
      ret = INT_MAX;
      long long sum = 0;
      for (auto x : adj[v]) {
        if (x == p) continue;
        sum += min(sol(x, v, 1, 0) + 1, sol(x, v, 0, 0));
      }
      for (auto x : adj[v]) {
        if (x == p) continue;
        ret = min(ret, sum + sol(x, v, 1, 0) + 1 -
                           min(sol(x, v, 1, 0) + 1, sol(x, v, 0, 0)));
      }
    }
  }
  return ret;
}
signed main() {
  memset(dp, -1, sizeof dp);
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long u;
    long long v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  long long res = 0;
  for (long long i = 0; i < adj[1].size(); i++) {
    res += sol(adj[1][i], 1, 1, 1);
  }
  cout << res << endl;
  return 0;
}
