#include #include #include #include typedef int32_t i32; void run (void) { i32 n; scanf ("%" SCNi32, &n); i32 *cnt = (i32 *) calloc (n + 1, sizeof (i32)); for (i32 i = 1; i < n; ++i) { i32 a, b; scanf ("%" SCNi32 "%" SCNi32, &a, &b); cnt[a]++; cnt[b]++; } i32 ans = 0; for (i32 i = 1; i <= n; ++i) { if (cnt[i] == 1) { ans++; } } printf("%" PRIi32 "\n", ans - 2); } int main (void) { run (); return 0; }