#include <bits/stdc++.h>
using namespace std;
const int M = (int)1e5 * 2 + 10;
vector<int> v[M];
int father[M];
int dis[M];
bool vis[M];
struct node {
  int num;
  int len;
};
bool operator<(node a, node b) { return a.len < b.len; }
void dfs(int now, int fa) {
  int len = v[now].size();
  for (int i = 0; i < len; ++i) {
    int t = v[now][i];
    if (t == fa) continue;
    dis[t] = dis[now] + 1;
    father[t] = now;
    dfs(t, now);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int a, b;
    scanf("%d %d", &a, &b);
    v[a].push_back(b);
    v[b].push_back(a);
  }
  dfs(1, 0);
  priority_queue<node> q;
  for (int i = 1; i <= n; ++i) {
    if (dis[i] > 2) {
      struct node t;
      t.num = i;
      t.len = dis[i];
      q.push(t);
    }
  }
  int ans = 0;
  while (!q.empty()) {
    int t = q.top().num;
    q.pop();
    if (vis[t]) continue;
    int u = father[t];
    vis[u] = 1;
    ans++;
    int len = v[u].size();
    for (int i = 0; i < len; ++i) vis[v[u][i]] = 1;
  }
  printf("%d\n", ans);
  return 0;
}
