#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define sz size() #define pb push_back #define mp make_pair #define fi first #define se second #define all(c) (c).begin(), (c).end() #define rep(i,a,b) for(ll i=(a);i<(b);++i) #define per(i,a,b) for(ll i=(b-1);i>=(a);--i) #define clr(a, b) memset((a), (b) ,sizeof(a)) #define ctos(c) string(1,c) #define print(x) cout<<#x<<" = "<>n>>m; clr(d,0); set > se2; rep(i,0,m){ ll a,b; cin>>a>>b; d[a][b] = 1; d[b][a] = 1; se2.insert(mp(a,b)); } vector > v(all(se2)); ll ans = 0; rep(i,0,v.sz){ rep(j,i+1,v.sz){ set se1; se1.insert(v[i].fi); se1.insert(v[i].se); se1.insert(v[j].fi); se1.insert(v[j].se); if(se1.sz!=4)continue; if(d[v[i].fi][v[j].fi]==1&&d[v[i].se][v[j].se]==1&&d[v[i].fi][v[j].se]!=1&&d[v[i].se][v[j].fi]!=1)ans++; if(d[v[i].fi][v[j].fi]!=1&&d[v[i].se][v[j].se]!=1&&d[v[i].fi][v[j].se]==1&&d[v[i].se][v[j].fi]==1)ans++; } } cout << ans/2 << endl; return 0; }