N, M = gets.split.map(&:to_i) E = Array.new(N + 1) { Array.new(N + 1, false) } M.times do a, b = gets.split.map(&:to_i) E[a][b] = E[b][a] = true end def checker(v1, v2, v3, v4) return false if E[v1][v2] return false if E[v3][v4] return false if !E[v1][v3] return false if !E[v1][v4] return false if !E[v2][v3] return false if !E[v2][v4] true end ans = 0 [*0..N - 1].combination(4) do |list| res = false res |= checker(list[0], list[1], list[2], list[3]) res |= checker(list[0], list[2], list[1], list[3]) res |= checker(list[0], list[3], list[1], list[2]) ans += 1 if res end puts ans