#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
vector<int> G[maxn];
long long dp[2][maxn], ans;
long long dfs(int v, int fa, int dep) {
  int len = G[v].size();
  if (dep == 2 && len == 1) return 0;
  dp[0][v] = 0;
  dp[1][v] = 1;
  long long cnt = 0, cnt2 = 0, mi = 1e18;
  for (int i = 0; i < len; i++) {
    int to = G[v][i];
    if (to == fa) continue;
    dp[1][v] += dfs(to, v, dep + 1);
    cnt += dp[0][to];
    cnt2 += dp[0][to];
    mi = min(mi, dp[1][to] - dp[0][to]);
  }
  if (dep == 2) mi = 0;
  if (mi > 1e9) mi = 1;
  dp[0][v] = cnt2 + mi;
  if (dp[1][v] < dp[0][v]) dp[0][v] = dp[1][v];
  if (dep == 2) ans += dp[0][v];
  return min(cnt, dp[1][v]);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    G[x].push_back(y);
    G[y].push_back(x);
  }
  dfs(1, 0, 0);
  cout << ans << endl;
  return 0;
}
