#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
vector<int> G[maxn];
int ans;
bool vis[maxn];
int dfs(int x, int father, int dis) {
  int c = 0;
  bool flag = 0;
  for (auto u : G[x]) {
    if (u != father) {
      c += dfs(u, x, dis + 1);
      if (vis[u]) {
        flag = 1;
      }
    }
  }
  if (c > 0 && dis > 1) {
    ++ans;
    vis[x] = 1;
    return 0;
  }
  if (flag) {
    return 0;
  }
  return 1;
}
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    int x, y;
    cin >> x >> y;
    --x, --y;
    G[x].push_back(y);
    G[y].push_back(x);
  }
  dfs(0, -1, 0);
  cout << ans << endl;
  return 0;
}
