#include using namespace std; typedef long long ll; int main() { int n; cin>>n; vector g[n]; for (int i=0;i>a>>b; a--;b--; g[a].push_back(b); g[b].push_back(a); } int ans=0; for (int i=0;i=3) ans+=g[i].size()-2; cout<