#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 123;
int n, dp[N][3][3];
vector<int> ed[N];
void load() {}
void dfs(int u, int p) {
  if (u != 1 && p != 1) dp[u][1][0] = 1;
  bool ok = 0;
  for (int i = 0; i < ed[u].size(); ++i) {
    int v = ed[u][i];
    if (v == p) continue;
    dfs(v, u);
    dp[u][1][0] += min(dp[v][1][0], min(dp[v][2][0], dp[v][2][1]));
    dp[u][2][0] += min(dp[v][1][0], dp[v][2][1]);
    if (dp[v][1][0] <= dp[v][2][1])
      dp[u][2][1] += dp[v][1][0], ok = 1;
    else
      dp[u][2][1] += dp[v][2][1];
  }
  int tmp = 1e9;
  if (!ok) {
    for (int i = 0; i < ed[u].size(); ++i) {
      int v = ed[u][i];
      if (v == p) continue;
      tmp = min(tmp, dp[v][1][0] - dp[v][2][1]);
    }
  }
  tmp = max(tmp, 0);
  if (!ok) dp[u][2][1] += tmp;
}
void trungtt() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    ed[u].push_back(v);
    ed[v].push_back(u);
  }
  dfs(1, 0);
  printf("%d", min(dp[1][1][0], min(dp[1][2][0], dp[1][2][1])));
}
int main() {
  load();
  trungtt();
  return 0;
}
