#include <bits/stdc++.h>
const int maxn = 1 << 19;
std::vector<int> g[maxn];
int ans, n;
int dfs(int x, int p) {
  int d = 2;
  for (int y : g[x]) {
    if (y != p) d = std::min(d, dfs(y, x));
  }
  if (x != 1 && p != 1 && d == 0) ++ans;
  return (d + 1) % 3;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
  ans = 0;
  dfs(1, 0);
  printf("%d\n", ans);
}
