#include <bits/stdc++.h>
using namespace std;
vector<int> graph[200005];
bool visited[200005];
bool marked[200005];
int parent[200005];
vector<int> far;
void dfs(int cv = 1, int par = 1, int dis = 0) {
  visited[cv] = true;
  parent[cv] = par;
  for (auto i : graph[cv])
    if (!visited[i]) dfs(i, cv, dis + 1);
  if (dis > 2) {
    far.push_back(cv);
  }
}
void doit() {
  int n, u, v;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> u >> v;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  dfs();
  int ans = 0;
  for (auto i : far)
    if (!marked[i]) {
      ++ans;
      ;
      marked[parent[i]] = true;
      for (auto j : graph[parent[i]]) marked[j] = true;
    }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  doit();
  return 0;
}
