#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
vector<int> G[maxn];
int vis[maxn], d[maxn], ans;
void dfs(int u, int fa) {
  int ok = 0;
  for (int i = 0; i < G[u].size(); i++) {
    if (fa == G[u][i]) continue;
    d[G[u][i]] = d[u] + 1;
    dfs(G[u][i], u);
    ok |= vis[G[u][i]];
  }
  if (d[u] > 2 && !ok && !vis[fa] && !vis[u]) {
    ans++;
    vis[fa] = 1;
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(1, 0);
  printf("%d\n", ans);
}
