#include #define rep(i, a, n) for(int i = a; i < n; i++) #define int long long using namespace std; typedef pair P; const int mod = 1000000007; const int INF = 1e18; signed main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vector c(n); rep(i, 0, n - 1){ int u, v; cin >> u >> v; u--; v--; c[u]++; c[v]++; } sort(c.begin(), c.end()); int ans = 0; vector b(n, 2); b[0] = b[1] = 1; rep(i, 0, n){ ans += abs(b[i] - c[i]); } cout << ans / 2 << endl; }