#include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; int N, M; int G[55][55]; map,int> ret; int v[4]; void dfs(int n){ if(n == 4){ if(G[v[0]][v[1]]==1 && G[v[1]][v[2]]==1 && G[v[2]][v[3]]==1 && G[v[3]][v[0]]==1 && G[v[0]][v[2]]==0 && G[v[1]][v[3]]==0){ map cnt; cnt[v[0]] = 1; cnt[v[1]] = 1; cnt[v[2]] = 1; cnt[v[3]] = 1; if(cnt.size() != 4) return; vector w; w.push_back(v[0]); w.push_back(v[1]); w.push_back(v[2]); w.push_back(v[3]); sort(ALLOF(w)); ret[w]=1; } return; } rep(i,N){ v[n] = i; dfs(n+1); } } int main(){ cin >> N >> M; rep(i,M){ int a, b; cin >> a >> b; G[a][b] = 1; G[b][a] = 1; } dfs(0); cout << ret.size() << endl; return 0; }