#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 50;
const int oo = 1e9;
const int mod = 1e9 + 7;
vector<int> g[N];
int ans, d[N], ans1, col[N];
void dfs(int u, int p) {
  bool need = 0;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (v == p) continue;
    d[v] = d[u] + 1;
    dfs(v, u);
    need |= col[v];
  }
  if (d[u] <= 2) return;
  if (!need && !col[p] && !col[u]) {
    col[p] = 1;
    ans++;
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, 0);
  cout << ans << endl;
}
