#include #include #include using namespace std; using LL = long long; using ULL = unsigned long long; int main() { int N; cin >> N; vector G[N + 1]; int a, b; for (int i = 0; i < N - 1; i++) { cin >> a >> b; G[a].push_back(b); G[b].push_back(a); } map D; for (int i = 1; i <= N; i++) { D[G[i].size()]++; } cout << D[1] - 2 << endl; }