#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
int n, dep[MAXN], id[MAXN], fa[MAXN], ans;
bool cov[MAXN];
vector<int> e[MAXN];
void dfs(int x) {
  for (vector<int>::iterator i = e[x].begin(); i < e[x].end(); i++) {
    if (*i == fa[x]) continue;
    dep[*i] = dep[fa[*i] = x] + 1;
    dfs(*i);
  }
}
void setCov(int x) {
  for (vector<int>::iterator i = e[x].begin(); i < e[x].end(); i++)
    cov[*i] = true;
  cov[x] = true;
}
bool cmp(int a, int b) { return dep[a] > dep[b]; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    e[u].push_back(v);
    e[v].push_back(u);
  }
  dfs(1);
  for (int i = 1; i <= n; i++)
    if (dep[i] <= 2) cov[i] = true;
  for (int i = 1; i <= n; i++) id[i] = i;
  sort(id + 1, id + n + 1, cmp);
  for (int i = 1, j; j = id[i]; i++)
    if (!cov[j]) {
      ans++;
      setCov(fa[j]);
    }
  printf("%d\n", ans);
}
