#include <bits/stdc++.h>
int dx[] = {0, 0, 1, -1, 2, 2, -2, -2, 1, -1, 1, -1};
int dy[] = {1, -1, 0, 0, 1, -1, 1, -1, 2, 2, -2, -2};
using namespace std;
vector<long long int> V, V2, V3, edj[200010];
bitset<200010> color;
long long int root, cnt = 0;
void dfs(long long int n, long long int ck) {
  color[n] = true;
  for (long long int i : edj[n]) {
    if (color[i] == false) {
      color[i] = true;
      long long int tm = ck ^ 1;
      if (tm == 0) {
        cnt++;
      }
      dfs(i, tm);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int tcase = 1;
  for (long long int test = 1; test <= tcase; test++) {
    long long int n;
    cin >> n;
    for (long long int i = 0; i < n - 1; i++) {
      long long int u, v;
      cin >> u >> v;
      edj[u].push_back(v);
      edj[v].push_back(u);
    }
    for (long long int i = 1; i <= n; i++) {
      if ((long long int)edj[i].size() == 1) {
        root = i;
        break;
      }
    }
    dfs(root, 0);
    long long int ans = cnt;
    cnt = 0;
    for (long long int i = 0; i <= n; i++) color[i] = false;
    root = edj[root][0];
    dfs(root, 0);
    ans = min(ans, cnt);
    cout << ans << "\n";
  }
}
