#include using namespace std; int main (){ int n,x; cin >> n; vector v(n,0); for(int i=0;i<2*(n-1);i++){ cin >> x; v.at(x-1) += 1; }//input if(v.at(0)-2 <0){cout << 0 << endl;} else{cout << v.at(0)-2 << endl;} }