#include <bits/stdc++.h>
using namespace std;
vector<int> adj[200001], vec;
bool vis[200001];
int d[200001], p[200001];
set<int> connected;
void dfs(int u = 1, int d = 0, int prev = -1) {
  vis[u] = 1;
  p[u] = prev;
  for (int i = 0; i < adj[u].size(); ++i)
    if (!vis[adj[u][i]]) dfs(adj[u][i], d + 1, u);
  if (d > 2) vec.push_back(u);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, i, j, u, v, x, ans = 0, l;
  cin >> n;
  for (i = 0; i < n - 1; ++i) {
    cin >> u >> v;
    d[u]++;
    d[v]++;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  if (n <= 3) {
    cout << 0;
    return 0;
  }
  dfs();
  for (i = 1; i <= n; ++i) vis[i] = 0;
  for (i = 0; i < vec.size(); ++i) {
    if (vis[vec[i]]) continue;
    ans++;
    vis[p[vec[i]]] = 1;
    for (j = 0; j < adj[p[vec[i]]].size(); ++j) vis[adj[p[vec[i]]][j]] = 1;
  }
  cout << ans;
  return 0;
}
