#include <bits/stdc++.h>
using namespace std;
const long long INF = 999999999999999999;
int n, m, clr[200005], pred[200005], ans;
vector<int> g[200005], t;
void dfs(int v = 1, int p = 0, int d = 0) {
  clr[v] = 1, pred[v] = p;
  for (int i = 0; i < g[v].size(); ++i)
    if (!clr[g[v][i]]) dfs(g[v][i], v, d + 1);
  if (d > 2) t.push_back(v);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0, a, b; i < n - 1; ++i) {
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs();
  for (int i = 0; i < t.size(); ++i) {
    int r = t[i], p = pred[t[i]];
    if (clr[r] != 2) {
      clr[p] = 2;
      for (int j = 0; j < g[p].size(); ++j) clr[g[p][j]] = 2;
      ans++;
    }
  }
  cout << ans << endl;
}
