#include <bits/stdc++.h>
using namespace std;
long long n, m, x, k, y, t, q, r, l, a, b, mid, ans, ans1, ans2, ANS;
string second;
char c;
vector<long long> v;
int A[100000], H[200001], C[100000];
map<int, int> mp;
vector<int> gr[200001];
void go(int x, int h) {
  H[x] = h;
  for (int i = 0; i < gr[x].size(); i++)
    if (H[gr[x][i]] == 0 && gr[x][i] != 1) go(gr[x][i], h + 1);
}
void go1(int x, int p) {
  H[x] = min(H[x], H[p] + 1);
  if (gr[x].size() == 1 && x != 1) {
    if (H[x] <= 2) return;
    H[p] = 1;
    H[x] = 2;
    ans++;
    return;
  }
  for (int i = 0; i < gr[x].size(); i++)
    if (gr[x][i] != p) {
      go1(gr[x][i], x);
      H[x] = min(H[x], H[gr[x][i]] + 1);
    }
  if (H[x] <= 2) return;
  H[p] = 1;
  H[x] = 2;
  ans++;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    gr[a].push_back(b);
    gr[b].push_back(a);
  }
  go(1, 0);
  go1(1, 0);
  cout << ans << endl;
}
