#include <bits/stdc++.h>
using namespace std;
const int N = 201000;
const int INF = 201000;
int n, flg = 0, md = 0, dpt[N], dp[N][2], fa[N], used[N], cnt = 0, head[N];
int read() {
  int x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x;
}
struct EDGE {
  int nxt, to;
} e[2 * N];
struct NODE {
  int d, u;
  bool operator<(const NODE &a) const { return d < a.d; }
};
void add(int u, int v) {
  e[++cnt].nxt = head[u];
  e[cnt].to = v;
  head[u] = cnt;
}
priority_queue<NODE> q;
void dfs(int u, int fath) {
  int i;
  fa[u] = fath;
  dpt[u] = dpt[fath] + 1;
  md = ((md > dpt[u]) ? md : dpt[u]);
  if (dpt[u] > 2) {
    flg = 1;
    q.push((NODE){dpt[u], u});
  }
  for (i = head[u]; i; i = e[i].nxt) {
    int v = e[i].to;
    if (v != fath) dfs(v, u);
  }
}
int main() {
  int i, j;
  n = read();
  memset(head, 0, sizeof(head));
  for (i = 1; i < n; i++) {
    int u = read(), v = read();
    add(u, v);
    add(v, u);
  }
  memset(dpt, 0, sizeof(dpt));
  memset(fa, 0, sizeof(fa));
  dpt[0] = -1;
  dfs(1, 0);
  if (!flg) {
    printf("0\n");
    return 0;
  }
  memset(dp, 0, sizeof(dp));
  memset(used, 0, sizeof(used));
  int ans = 0;
  while (!q.empty()) {
    NODE ntp = q.top();
    q.pop();
    if (used[ntp.u]) continue;
    int u = fa[ntp.u];
    used[u] = 1;
    for (i = head[u]; i; i = e[i].nxt) {
      int v = e[i].to;
      used[v] = 1;
    }
    ans++;
  }
  printf("%d\n", ans);
  return 0;
}
