#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
vector<int> edges[N];
int cnt = 0;
int dfs(int cur, int prt, int dist) {
  int ans = -100;
  for (int next : edges[cur]) {
    if (next == prt) continue;
    int res = dfs(next, cur, dist + 1);
    if (res != 0) ans = max(ans, res);
  }
  if (ans == -100) ans = 0;
  if (ans == 1 && dist > 1) {
    cnt += 1;
    ans = -1;
  } else {
    ans += 1;
    if (dist <= 2) ans = min(ans, 0);
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i < n; i += 1) {
    int u, v;
    cin >> u >> v;
    edges[u].push_back(v);
    edges[v].push_back(u);
  }
  dfs(1, 0, 0);
  cout << cnt << endl;
}
