#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 4;
vector<int> g[MAX];
int res;
bool vis[MAX];
void dfs(int u, int pu, int dis) {
  for (auto& v : g[u]) {
    if (v == pu) continue;
    dfs(v, u, dis + 1);
  }
  if (vis[u]) return;
  for (auto& v : g[u])
    if (vis[v]) return;
  if (dis > 2) {
    vis[pu] = true;
    ++res;
  }
}
void solve() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, -1, 0);
  printf("%d\n", res);
}
int main() {
  solve();
  return 0;
}
