#include int max(int number) { if (number > 0) return number; else return 0; } int main(void){ int i; int N; int valency[100001] = {0}; scanf("%d", &N); for (i=1; i<=2*N-2; i++) { int read; scanf("%d", &read); valency[read]++; } int ans = 0; for (i=1; i<=N; i++){ ans += max(valency[i] - 2); } printf("%d\n", ans); return 0; }