#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int maxn = 2e5 + 6;
int n, x, y, ans, dist[maxn];
vector<int> G[maxn];
void dfs(int cur, int pre, int cnt) {
  dist[cur] = cnt;
  bool flag = false;
  for (int next : G[cur]) {
    if (next == pre) continue;
    dfs(next, cur, cnt + 1);
    if (dist[next] > 2) {
      dist[cur] = 1;
      dist[pre] = 2;
      flag = true;
    }
  }
  if (flag) ans++;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ans = 0;
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    cin >> x >> y;
    G[x].push_back(y);
    G[y].push_back(x);
  }
  dfs(1, 1, 0);
  cout << ans << "\n";
  return 0;
}
