def check(x, y): for z in range(n): if z!=x and z!=y and G[z][x]==1 and G[z][y]==1 and G[x][y]==0: return False return True n, m = map(int, input().split()) G = [[0]*n for _ in range(n)] for _ in range(m): a, b = map(int, input().split()) G[a-1][b-1] = 1 G[b-1][a-1] = 1 ans = 0 for i in range(n): for j in range(i+1, n): for k in range(j+1, n): if check(i, j) and check(j, k) and check(k, i): ans += 1 print(ans)