#include using namespace std; using Graph=vector>; void rep(int v,int pv,int cc,vector &col,Graph &g){ col[v]=cc; for(auto &nx : g[v]){ if(nx==pv){continue;} rep(nx,v,1-cc,col,g); } } int main(){ int n; cin >> n; Graph g(n+1); for(int i=1;i> u >> v; g[u].push_back(v); g[v].push_back(u); } vector col(n+1); rep(1,-1,0,col,g); int sig=0; for(int i=1;i<=n;i++){sig+=col[i];} cout << min(sig,n-sig) << '\n'; return 0; }