#include <bits/stdc++.h>
using namespace std;
int n, x, y, ans;
vector<int> a[200000 + 10];
int dfs(int x, int y = 0) {
  int s = 2, z;
  for (int i = 0; i < a[x].size(); i++) {
    z = a[x][i];
    if (z != y) s = min(s, dfs(z, x));
  }
  if (x != 1 && y != 1 && s == 0) ans++;
  return (s + 1) % 3;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    a[x].push_back(y), a[y].push_back(x);
  }
  dfs(1, 0);
  printf("%d\n", ans);
  return 0;
}
