// yukicoder no.488 main.go // #D package main import ( "bufio" "fmt" "io" "os" ) func check(edge [][]bool, p1, p2, p3, p4 int) bool { if edge[p1][p3] || edge[p2][p4] { return false } return edge[p4][p1] && edge[p1][p2] && edge[p2][p3] && edge[p3][p4] } func solve(in io.Reader, out, err io.Writer) { num, num_edge := 0, 0 fmt.Fscan(in, &num, &num_edge) edgeTable := make([][]bool, num) for i := range edgeTable { edgeTable[i] = make([]bool, num) } for i := 0; i < num_edge; i++ { a, b := 0, 0 fmt.Fscan(in, &a, &b) edgeTable[a][b], edgeTable[b][a] = true, true } count := 0 for i := 0; i < num; i++ { for jj := i + 1; jj < num; jj++ { for kkk := jj + 1; kkk < num; kkk++ { for LLLL := kkk + 1; LLLL < num; LLLL++ { if check(edgeTable, i, jj, kkk, LLLL) { count++ } if check(edgeTable, i, kkk, LLLL, jj) { count++ } if check(edgeTable, i, LLLL, jj, kkk) { count++ } } } } } fmt.Fprintln(out, count) } func main() { br := bufio.NewReaderSize(os.Stdin, int(1e7)) solve(br, os.Stdout, os.Stderr) }