#include <bits/stdc++.h>
using namespace std;
vector<int> M[1000010];
int dep[1000100], n, x, y, ans;
void dfs(int x, int father, int step) {
  dep[x] = step;
  int flag = 0;
  int l = M[x].size();
  for (int i = 0; i < l; ++i) {
    if (M[x][i] == father) continue;
    dfs(M[x][i], x, step + 1);
    if (dep[M[x][i]] > 2) {
      flag = 1;
      dep[x] = 1;
      dep[father] = 2;
    }
  }
  ans += flag;
}
int main() {
  scanf("%d", &n);
  ans = 0;
  for (int i = 1; i < n; ++i) {
    scanf("%d%d", &x, &y);
    M[x].push_back(y);
    M[y].push_back(x);
  }
  dfs(1, 1, 0);
  printf("%d\n", ans);
  return 0;
}
