#include <bits/stdc++.h>
using namespace std;
vector<int> G[200001];
int ans, n;
int dfs(int x, int y) {
  int i, dis = 2;
  for (i = 0; i < G[x].size(); i++) {
    int v = G[x][i];
    if (v == y) continue;
    dis = min(dis, dfs(v, x));
  }
  if (dis == 0 && x != 1 && y != 1) ans++;
  return (dis + 1) % 3;
}
int main() {
  int i, A, B;
  cin >> n;
  for (i = 0; i < n - 1; i++) {
    cin >> A >> B;
    G[A].push_back(B);
    G[B].push_back(A);
  }
  ans = 0;
  dfs(1, 0);
  cout << ans << endl;
}
