//#define _GLIBCXX_DEBUG #include #define rep(i, n) for(int i=0; i; using vs = vector; using vi = vector; using vvi = vector; template using PQ = priority_queue; template using PQG = priority_queue, greater >; const int INF = 0xccccccc; const ll LINF = 0xcccccccccccccccLL; template inline bool chmax(T1 &a, T2 b) {return a < b && (a = b, true);} template inline bool chmin(T1 &a, T2 b) {return a > b && (a = b, true);} template istream &operator>>(istream &is, pair &p) { return is >> p.first >> p.second;} template ostream &operator<<(ostream &os, const pair &p) { return os << p.first << ' ' << p.second;} #define N 60 //head int n, m; vi G[N]; int ans; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> n >> m; rep(i, m) { int a, b; cin >> a >> b; G[a].emplace_back(b); G[b].emplace_back(a); } rep(i, n) rep(j, i) rep(k, j) rep(l, k) { int u[] = {l, k, j, i}; bool fl = false; rep(ii, 4) { int cnt = 0; for(int ne:G[u[ii]]) { int *itr = find(u, u+4, ne); if(itr != u+4 and *itr == ne) cnt++; } if(cnt != 2) { fl = true; break; } } if(!fl) ans++; } cout << ans << endl; }