#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<limits>
#include<climits>
#include<cmath>
#include<functional>
#include<ctime>
#include<cstdlib>
#include<fstream>
#include<typeinfo>
using namespace std;
typedef long long int ll;
typedef unsigned long long int u64;
typedef unsigned u32;
const int MAX = 1<<17;
int cnt[2],n;
vector <int> v[MAX];
bool used[MAX];
void DFS(int node, bool p)
{
used[node]=true;
cnt[p]++;
int i;
for(i=0;i<v[node].size();i++)
if(!used[v[node][i]])
DFS(v[node][i],p^1);
}
void input()
{
scanf("%d", &n);
int i,a,b;
for(i=1;i<n;i++)
{
scanf("%d %d", &a, &b);
v[a].push_back(b);
v[b].push_back(a);
}
}
void solve()
{
DFS(1,0);
printf("%d\n", min(cnt[0],cnt[1]));
}
int main()
{
input();
solve();
return 0;
}
I2luY2x1ZGU8Y3N0ZGlvPgojaW5jbHVkZTxpb3N0cmVhbT4KI2luY2x1ZGU8YWxnb3JpdGhtPgojaW5jbHVkZTxzdHJpbmc+CiNpbmNsdWRlPGNzdHJpbmc+CiNpbmNsdWRlPHZlY3Rvcj4KI2luY2x1ZGU8c3RhY2s+CiNpbmNsdWRlPHF1ZXVlPgojaW5jbHVkZTxkZXF1ZT4KI2luY2x1ZGU8bWFwPgojaW5jbHVkZTxzZXQ+CiNpbmNsdWRlPGxpbWl0cz4KI2luY2x1ZGU8Y2xpbWl0cz4KI2luY2x1ZGU8Y21hdGg+CiNpbmNsdWRlPGZ1bmN0aW9uYWw+CiNpbmNsdWRlPGN0aW1lPgojaW5jbHVkZTxjc3RkbGliPgojaW5jbHVkZTxmc3RyZWFtPgojaW5jbHVkZTx0eXBlaW5mbz4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp0eXBlZGVmIGxvbmcgbG9uZyBpbnQgbGw7CnR5cGVkZWYgdW5zaWduZWQgbG9uZyBsb25nIGludCB1NjQ7CnR5cGVkZWYgdW5za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