#include <bits/stdc++.h>
using namespace std;
vector<int> adj[200005];
int dis[200005];
int answer = 0;
void optimizeIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
void dfs(int u, int parent) {
  dis[u] = dis[parent] + 1;
  for (int c : adj[u]) {
    if (c != parent) dfs(c, u);
  }
}
void calculate(int u, int parent) {
  for (int c : adj[u]) {
    if (c != parent) {
      dis[c] = min(dis[u] + 1, dis[c]);
      calculate(c, u);
      dis[u] = min(dis[c] + 1, dis[u]);
    }
  }
  if (dis[u] > 2) {
    dis[parent] = 1;
    dis[u] = 2;
    answer++;
  }
}
int main() {
  optimizeIO();
  int n;
  int x, y;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  dis[0] = -1;
  dfs(1, 0);
  calculate(1, 0);
  cout << answer << endl;
  return 0;
}
