#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n; cin >> n;
    vector<int> t[n];

    for (int i = 0; i < n-1; ++i) {
        int u, v;
        cin >> u >> v;
        --u; --v;
        t[u].push_back(v);
        t[v].push_back(u);
    }

    if (n == 3) { cout << 2; return 0;}
    else {
        if (!(n%2)) {cout << n/2; return 0;}
        else { cout << ceil(n/2); return 0;}
    }
}