from itertools import combinations from sys import stdin, stdout import numpy as np input = lambda: stdin.readline().rstrip() write = stdout.write def main(): N, M = map(int, input().split()) AB = [tuple(map(int, input().split())) for _ in [0] * M] edge = np.zeros((N, N)) for a, b in AB: edge[a][b] = edge[b][a] = 1 square = 0 for a, b, c, d in combinations(range(N), 4): if all((edge[a][b] + edge[a][c] + edge[a][d] == 2, edge[b][a] + edge[b][c] + edge[b][d] == 2, edge[c][a] + edge[c][b] + edge[c][d] == 2, edge[d][a] + edge[d][b] + edge[d][c] == 2)): square += 1 print(square) main()