#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
vector<int> edge[maxn];
int dp[maxn][3];
void dfs(int u, int fa) {
  dp[u][0] = 1;
  dp[u][1] = 0;
  dp[u][2] = 1e9;
  for (int i = 0; i < edge[u].size(); i++) {
    int v = edge[u][i];
    if (v == fa) continue;
    dfs(v, u);
    dp[u][2] = min(dp[u][2] + dp[v][2], dp[u][1] + dp[v][0]);
    dp[u][0] += dp[v][1];
    dp[u][1] += dp[v][2];
  }
  dp[u][2] = min(dp[u][2], dp[u][0]);
  dp[u][1] = min(dp[u][1], dp[u][2]);
}
int main() {
  int n, u, v;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  dfs(1, 0);
  int ans = 0;
  for (int i = 0; i < edge[1].size(); i++) ans += dp[edge[1][i]][0] - 1;
  printf("%d\n", ans);
  return 0;
}
