#include using namespace std; int main(){ int N; cin >> N; vector> E(N); for (int i = 0; i < N - 1; i++){ int a, b; cin >> a >> b; a--; b--; E[a].push_back(b); E[b].push_back(a); } int cnt = 0; for (int i = 0; i < N; i++){ if (E[i].size() == 1){ cnt++; } } cout << cnt - 2 << endl; }