#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int pre[maxn], dis[maxn];
bool vis[maxn];
vector<int> vec[maxn];
int n, a, b;
priority_queue<pair<int, int> > prio;
void dfs(int x, int f, int s) {
  dis[x] = s;
  pre[x] = f;
  for (int i = 0; i < vec[x].size(); ++i) {
    if (vec[x][i] == f) continue;
    dfs(vec[x][i], x, s + 1);
  }
}
void couts() {
  for (int i = 1; i <= n; ++i) printf("%d���������%d\n", i, dis[i]);
  for (int i = 1; i <= n; ++i) printf("%d���ĸ��ڵ���%d\n", i, pre[i]);
}
int main() {
  memset(vis, 0, sizeof(vis));
  memset(dis, 0, sizeof(dis));
  scanf("%d", &n);
  for (int i = 0; i < n - 1; ++i) {
    scanf("%d%d", &a, &b);
    vec[a].push_back(b);
    vec[b].push_back(a);
  }
  dfs(1, 0, 0);
  for (int i = 1; i <= n; ++i)
    if (dis[i] > 2) prio.push(make_pair(dis[i], i));
  int res = 0;
  while (prio.size()) {
    int u = prio.top().second;
    prio.pop();
    if (vis[u]) continue;
    res++;
    u = pre[u];
    vis[u] = 1;
    for (int i = 0; i < vec[u].size(); ++i) vis[vec[u][i]] = 1;
  }
  printf("%d\n", res);
  return 0;
}
