#include #include #define range(i,a,b) for(int i = (a); i < (b); i++) #define rep(i,b) for(int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; const int INF = 2000000000; using namespace std; template < class BidirectionalIterator > bool next_combination ( BidirectionalIterator first1 , BidirectionalIterator last1 , BidirectionalIterator first2 , BidirectionalIterator last2 ){ if (( first1 == last1 ) || ( first2 == last2 )) { return false ; } BidirectionalIterator m1 = last1 ; BidirectionalIterator m2 = last2 ; --m2; while (--m1 != first1 && !(* m1 < *m2 )){ } bool result = (m1 == first1 ) && !(* first1 < *m2 ); if (! result ) { while ( first2 != m2 && !(* m1 < * first2 )) { ++ first2 ; } first1 = m1; std :: iter_swap (first1 , first2 ); ++ first1 ; ++ first2 ; } if (( first1 != last1 ) && ( first2 != last2 )) { m1 = last1 ; m2 = first2 ; while (( m1 != first1 ) && (m2 != last2 )) { std :: iter_swap (--m1 , m2 ); ++ m2; } std :: reverse (first1 , m1 ); std :: reverse (first1 , last1 ); std :: reverse (m2 , last2 ); std :: reverse (first2 , last2 ); } return ! result ; } template < class BidirectionalIterator > bool next_combination ( BidirectionalIterator first , BidirectionalIterator middle , BidirectionalIterator last ) { return next_combination (first , middle , middle , last ); } int main(){ int n, m; int g[55][55] = {0}; cin >> n >> m; rep(i,m){ int a, b; cin >> a >> b; g[a][b] = g[b][a] = 1; } if(n <= 3){ cout << 0 << endl; return 0; } vector v; int ans = 0; rep(i,n) v.emplace_back(i); do{ int sg[4][4]; int cnt = 0; rep(i,4){ int c = 0; rep(j,4){ if(g[v[i]][v[j]]) c++; } if(c == 2) cnt++; } if(cnt == 4) ans++; }while(next_combination(v.begin(), v.begin() + 4, v.end())); cout << ans << endl; }