import sys; input = sys.stdin.buffer.readline sys.setrecursionlimit(10**7) from collections import defaultdict con = 10 ** 9 + 7; INF = float("inf") def getlist(): return list(map(int, input().split())) def judge(table, i, j, k, l): if table[i][j] == 1 and table[j][k] == 1 and table[k][l] == 1 and table[l][i] == 1 and table[i][k] == 0 and table[j][l] == 0: return 1 else: return 0 #処理内容 def main(): N, M = getlist() table = [[0] * N for i in range(N)] for i in range(M): a, b = getlist() a -= 1; b -= 1 table[a][b] = 1 table[b][a] = 1 ans = 0 for i in range(N): for j in range(i + 1, N): for k in range(j + 1, N): for l in range(k + 1, N): ans += judge(table, i, j, k, l) ans += judge(table, i, j, l, k) ans += judge(table, i, k, j, l) ans += judge(table, i, k, l, j) ans += judge(table, i, l, j, k) ans += judge(table, i, l, k, j) print(ans // 2) if __name__ == '__main__': main()