using System; using System.Numerics; public class Program { static bool checkSquare(bool[,] edge, int i, int j, int k, int l) { return edge[i, j] && edge[j, k] && edge[k, l] && edge[l, i] && !edge[i, k] && !edge[j, l]; } static void Main() { string[] s = Console.ReadLine().Split(); int N = int.Parse(s[0]); int M = int.Parse(s[1]); bool[,] edge = new bool[N, N]; for (int i = 0; i < M; i++) { string[] p = Console.ReadLine().Split(); int a = int.Parse(p[0]); int b = int.Parse(p[1]); edge[a, b] = true; edge[b, a] = true; } int count = 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++) { if (checkSquare(edge, i, j, k, l)) { count++; } if (checkSquare(edge, i, k, l, j)) { count++; } if (checkSquare(edge, i, l, j, k)) { count++; } } } } } Console.WriteLine(count); } }