#include #include #include #include #include #define rep(i, n) for (i = 0; i < n; i++) #define rrep(i, n) for (i = n; i >= 0; i--) #define max(a, b) (a > b ? a : b) #define min(a, b) (a < b ? a : b) typedef long long ll; bool graph[50][50]; int cntEdge(int a, int b, int c, int d, int x) { int i, cnt = 0; if (a != x && graph[a][x]) cnt++; if (b != x && graph[b][x]) cnt++; if (c != x && graph[c][x]) cnt++; if (d != x && graph[d][x]) cnt++; return cnt; } bool isSquare(int a, int b, int c, int d) { int ae = cntEdge(a, b, c, d, a); int be = cntEdge(a, b, c, d, b); int ce = cntEdge(a, b, c, d, c); int de = cntEdge(a, b, c, d, d); return ae == 2 && be == 2 && ce == 2 && de == 2; } int main() { int n, m; scanf("%d %d", &n, &m); int i, j, k, l; rep(i, m) { int a, b; scanf("%d %d", &a, &b); graph[a][b] = true; graph[b][a] = true; } int ans = 0; rep(i, n) rep(j, n) { while (i == j) j++; if (j >= n) break; rep(k, n) { while (i == k || j == k) k++; if (k >= n) break; rep(l, n) { while (i == l || j == l || k == l) l++; if (l >= n) break; if (isSquare(i, j, k, l)) ans++; } } } printf("%d\n", ans / 24); return 0; }