#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using lli = long long int; template void init_n(vector& v, size_t n, U x) { v = vector(n, x); } template void init_n(vector& v, size_t n) { init_n(v, n, T()); } template void read_n(vector& v, size_t n, size_t o = 0) { v = vector(n+o); for (lli i=o; i> v[i]; } template void read_n(T a[], size_t n, size_t o = 0) { for (lli i=o; i> a[i]; } template T gabs(const T& x) { return max(x, -x); } #define abs gabs lli n, c[100001]; int main() { cin >> n; lli ans = 0; for (lli i=0; i> a >> b; c[a]++; c[b]++; } for (lli i=0; i<=n; ++i) { ans += max(0ll, c[i]-2); } cout << ans << '\n'; return 0; }