#include typedef long long ll; #define FOR(i,a,b) for(ll i=(a);i<(b);i++) #define REP(i,a) FOR(i,0,a) using namespace std; ll N; const ll MAX_N=1e5; vector G[MAX_N]; ll dst[MAX_N]; void dfs(ll v,ll p,ll d){ dst[v]=d; for(auto e:G[v]){ if(e!=p){ dfs(e,v,d+1); } } } int main(){ ios::sync_with_stdio(false); cin.tie(0); cin>>N; REP(i,N-1){ ll a,b; cin>>a>>b; a--; b--; G[a].push_back(b); G[b].push_back(a); } ll ans=0; REP(i,N){ ans+=max((ll)G[i].size()-2,0ll); } cout<