#include <bits/stdc++.h>
using namespace std;
int n, a, b, ans, p[200005], dist[200005];
vector<int> adj[200005];
set<pair<int, int> > st;
void dfs(int x, int pa, int d) {
  if (d > 2) st.insert(pair<int, int>(-d, x));
  dist[x] = d;
  for (auto it : adj[x]) {
    if (it == pa) continue;
    p[it] = x;
    dfs(it, x, d + 1);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = (int)1; i <= (int)n - 1; i++) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  dfs(1, 0, 0);
  while (!st.empty()) {
    int x = (st.begin()->second);
    x = p[x];
    ans++;
    for (auto it : adj[x]) st.erase(pair<int, int>(-dist[it], it));
    st.erase(pair<int, int>(-dist[x], x));
  }
  cout << ans;
}
