#include using namespace std; typedef long long ll; const int S = (1 << 20); int n, x, y, ans; vector G[S]; bool odw[S]; void dfs(int node){ odw[node] = true; int to_add = -1; for (auto e : G[node]) if (!odw[e]){ to_add ++; dfs(e); } ans += max(0, to_add); } int main(){ ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0); cin >> n; for (int i = 0; i < n; i ++){ cin >> x >> y; G[x].push_back(y); G[y].push_back(x); } dfs(1); cout << ans << endl; return 0; }