#include typedef long long ll; using namespace std; int INF = 1LL << 30; int MOD = 1e9+7; main(){ int N,M; cin >> N >> M; int graph[N][N] = {}; for(int i = 0;i < M;i++){ int a,b; cin >> a >> b; graph[a][b] = graph[b][a] = 1; } int cnt = 0; for(int i = 0;i < N;i++){ for(int j = i+1;j < N;j++){ for(int k = j+1;k < N;k++){ for(int l = k+1;l < N;l++){ vector A({i,j,k,l}); do{ bool flag = 0; for(int ind = 0;ind < 4;ind++){ if(!graph[A[ind] ][ A[ (ind+1) % 4 ] ])flag = 1; } if(flag)continue; /* if(i == 1 && j == 2 && k == 6 && l == 7){ cout << " " << A[0] << A[1] << A[2] << A[3] << endl; } */ if(!graph[ A[0] ][ A[2] ] && !graph[ A[1] ][ A[3] ]){ //cout << A[0] << A[1] << A[2] << A[3] << endl; cnt++; break; } }while(next_permutation(A.begin(), A.end())); } } } } cout << cnt << endl; }