#include <bits/stdc++.h>
using namespace std;
const int MX = 200 + 7;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
int n;
const int maxn = 200000 + 42;
int dp[maxn][3];
int head[maxn];
int tot;
struct node {
  int u, v;
  int net;
} E[maxn * 2];
void init() {
  memset(head, -1, sizeof(head));
  tot = 0;
}
void build(int u, int v) {
  E[tot].u = u;
  E[tot].v = v;
  E[tot].net = head[u];
  head[u] = tot++;
}
void dfs(int u, int p) {
  dp[u][0] = 1;
  int flag = 0;
  for (int i = head[u]; ~i; i = E[i].net) {
    if (E[i].v == p) continue;
    dfs(E[i].v, u);
    flag = 1;
  }
  if (!flag) {
    dp[u][1] = -1;
    dp[u][2] = 0;
    return;
  }
  for (int i = head[u]; ~i; i = E[i].net) {
    int v = E[i].v;
    if (v == p) continue;
    int add = dp[v][0];
    if (dp[v][1] != -1) {
      add = min(add, dp[v][1]);
    }
    if (dp[v][2] != -1) {
      add = min(add, dp[v][2]);
    }
    dp[u][0] += add;
  }
  int mx = INF;
  for (int i = head[u]; ~i; i = E[i].net) {
    int v = E[i].v;
    if (v == p) continue;
    if (dp[v][1] == -1) {
      dp[u][1] += dp[v][0];
      mx = 0;
    } else {
      if (dp[v][0] <= dp[v][1]) {
        mx = 0;
        dp[u][1] += dp[v][0];
      } else {
        dp[u][1] += dp[v][1];
        mx = min(mx, dp[v][0] - dp[v][1]);
      }
    }
  }
  dp[u][1] += mx;
  for (int i = head[u]; ~i; i = E[i].net) {
    int v = E[i].v;
    if (v == p) continue;
    if (dp[v][1] == -1) {
      dp[u][2] = -1;
      break;
    }
    dp[u][2] += dp[v][1];
  }
}
int main() {
  scanf("%d", &n);
  init();
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    build(u, v);
    build(v, u);
  }
  dfs(1, -1);
  long long ans = 0;
  for (int i = head[1]; ~i; i = E[i].net) {
    ans += dp[E[i].v][0];
    ans--;
  }
  cout << ans << endl;
}
